var Model = {
        StationImgPath: "",
        stationFilePath: "",
        fileInfo: [],
        elements: [],
        fhSwitchTable: [],
        ddSwitchTable: [],
        categories: {},
        page: {
            backgroundColor: "255,255,255",
            width: 2580,
            height: 1080,
            padding: 30,
            showGrid: !0,
            gridSize: 1,
            defaultTrackColor: "rgba(0,0,0,1)",
            trackSelectedColor: "rgba(150,150,50,1)",
            jzButtonColor: "rgba(0,150,0,1)",
            czButtonColor: "rgba(0,150,0,1)",
            tgButtonColor: "rgba(0,150,0,1)",
            ydButtonColor: "rgba(0,0,255,1)",
            dcButtonColor: "rgba(0,0,255,1)",
            bgButtonColor: "rgba(0,255,0,1)",
            pdzdButtonColor: "rgba(0,255,0,1)",
            lczdButtonColor: "rgba(0,255,0,1)",
            dczdButtonColor: "rgba(0,0,255,1)"
        },
        deleteElement: function(t) {
            t >= 0 && t < Model.elements.length && Model.elements.splice(t, 1)
        },
        setSelected: function(t) {
            t > -1 && t < Model.elements.length && (Model.elements[t].selected = !0)
        },
        cancelSelected: function() {
            for (var t = 0; t < Model.elements.length; t++) Model.elements[t].selected = !1
        },
        moveShape: function(t, e, n) {
            t >= 0 && t < Model.elements.length && Model.elements[t].MoveOffset(e, n)
        },
        zoomShape: function(t) {
            for (var e = 0; e < Model.elements.length; e++) Model.elements[e].renderShape(t)
        },
        getCategorByID: function(t) {
            return t >= 0 && t < Model.elements.length ? Model.elements[t].category: void 0
        },
        getNameByID: function(t) {
            return t >= 0 && t < Model.elements.length ? Model.elements[t].name: -1
        },
        getIDByIndex: function(t) {
            return t >= 0 && t < Model.elements.length ? Model.elements[t].id: -1
        },
        getIndexByID: function(t) {
            for (var e = 0; e < Model.elements.length; e++) if (Model.elements[e].id == t) return e;
            return - 1
        },
        getNodeByID: function(t) {
            return t >= 0 && t < Model.elements.length ? Model.elements[t] : -1
        },
        getNodeByName: function(t) {
            for (var e = 0; e < Model.elements.length; e++) if (Model.elements[e].name == t) return e;
            return - 1
        },
        existedByName: function(t, e, n) {
            for (var o = 0,
                     i = 0; i < Model.elements.length; i++) if (Model.elements[i].category == t && Model.elements[i].name == e) {
                if (n == i) continue;
                if (o++, o > 0) return ! 0
            }
            return ! 1
        },
        setDefalutStatu: function() {
            for (var t = 0; t < Model.elements.length; t++) Model.setShowStatu(t, "DEFAULT")
        },
        setShowStatu: function(t, e) {
            t >= 0 && t < Model.elements.length && ("DEFAULT" == e ? (Model.elements[t].OneStatu = !1, Model.elements[t].otherStatu = !1, Model.elements[t].SelectedStatu = !1) : "ONE" == e ? (Model.elements[t].OneStatu = !0, Model.elements[t].otherStatu = !1, Model.elements[t].SelectedStatu = !1) : "OTHER" == e ? (Model.elements[t].OneStatu = !1, Model.elements[t].otherStatu = !0, Model.elements[t].SelectedStatu = !1) : "SELECTEDDS" == e && (Model.elements[t].SelectedStatu = !0, Model.elements[t].OneStatu = !1, Model.elements[t].otherStatu = !1))
        },
        findOther: function(t, e) {
            if (0 > t && t >= Model.elements.length) return [];
            for (var o = [], i = [Model.elements[t].component.chaZhi[1], Model.elements[t].component.chaWan[1]], s = 0; 2 > s; s++) for (var a = 0; a < this.elements.length; a++) if (a != t && "SWITCH" == this.elements[a].category) {
                if (Utils.inPoint(e, i[s], this.elements[a].component.chaZhi[1]) && !this.elements[a].SelectedStatu) {
                    for (var h = !1,
                             r = 0; r < o.length; r++) if (this.elements[a].id == o[r]) {
                        h = !0;
                        break
                    }
                    h ? o.splice(r, 1) : o.push(this.elements[a].id)
                }
                if (Utils.inPoint(e, i[s], this.elements[a].component.chaWan[1]) && !this.elements[a].SelectedStatu) {
                    for (var h = !1,
                             r = 0; r < o.length; r++) if (this.elements[a].id == o[r]) {
                        h = !0;
                        break
                    }
                    h ? o.splice(r, 1) : o.push(this.elements[a].id)
                }
            }
            return o
        },
        dsExisted: function(t) {
            return 0 > t || t >= Model.elements.length ? !1 : Model.elements[t].SelectedStatu ? !0 : void 0
        },
        cancelDSSelected: function(t) {
            if (0 > t || t >= Model.elements.length) return ! 1;
            Model.elements[t].SelectedStatu = !1;
            var e = Model.elements[t].otherSwitch;
            Model.elements[t].otherSwitch = -1,
                t = Model.getIndexByID(e),
            t >= 0 && t < Model.elements.length && (Model.elements[t].SelectedStatu = !1, Model.elements[t].otherSwitch = -1)
        },
        dataValidCheck: function(t, e, n) {
            if (0 > t || t >= Model.elements.length) return "对象不存在";
            switch (Model.elements[t].category) {
                case "SWITCH":
                    return Model.switchDataCheck(t, e, n);
                case "TRACK":
                    return Model.trackDataCheck(t, e, n);
                case "SIGNAL":
                    return Model.signalDataCheck(t, e, n);
                case "TUO_GUI_QI":
                    break;
                case "BUTTON":
                    return Model.TGQDataCheck(t, e, n)
            }
        },
        switchDataCheck: function(t, e, n) {
            var o = [];
            switch (e) {
                case "name":
                    isNaN(n) ? o.push("道岔名是数字，请正确填写！") : (n > 200 && o.push("道岔名小于200，请修改!"), Model.existedByName("SWITCH", n, t) && o.push("道岔名已经存在，请确认!"), "" == n && o.push("道岔名为空，请确认!"));
                    break;
                case "otherdbcross":
                case "otherSwitch":
                    "" != n && (isNaN(n) ? o.push("道岔名是数字，请正确填写！") : -1 != n && -1 == Model.getNodeByName(n) && o.push("道岔名不存在，请确认!"));
                    break;
                case "throat":
                    "" == n && o.push("咽喉区为空或填写错，请正确填写！");
                    break;
                case "track":
                    "" == n && o.push("道岔区段不能为空，请正确填写！");
                    break;
                case "qianNode":
                case "zhiNode":
                case "wanNode":
                    "" != n && -1 == Model.getNodeByName(n) && o.push("该对象不存在，请确认!");
                    break;
                default:
                    o.push("属性不存在，程序错误！")
            }
            return o
        },
        trackDataCheck: function(t, e, n) {
            var o = [];
            switch (e) {
                case "name":
                    Model.existedByName("TRACK", n, t) && o.push("区段名已经存在，请确认!"),
                    "" == n && o.push("区段名为空，请确认!");
                    break;
                case "throat":
                    "" == n && o.push("咽喉区为空或填写错，请正确填写！");
                    break;
                case "qianNode":
                case "houNode":
                    "" != n && -1 == Model.getNodeByName(n) && o.push("该对象不存在，请确认!");
                    break;
                default:
                    o.push("属性不存在，程序错误！")
            }
            return o
        },
        signalDataCheck: function(t, e, n) {
            var o = [];
            switch (e) {
                case "name":
                    Model.existedByName("SIGNAL", n, t) && o.push("信号机名已经存在，请确认!"),
                    "" == n && o.push("信号机名为空，请确认!");
                    break;
                case "throat":
                    "" == n && o.push("咽喉区为空或填写错，请正确填写！");
                    break;
                case "otherSignal":
                    "" != n && -1 != n && -1 == Model.getNodeByName(n) && o.push("信号机名不存在，请确认!");
                    break;
                case "qianNode":
                case "houNode":
                    "" != n && -1 == Model.getNodeByName(n) && o.push("该对象不存在，请确认!");
                    break;
                default:
                    o.push("属性不存在，程序错误！")
            }
            return o
        },
        TGQDataCheck: function(t, e, n) {
            var o = [];
            switch (e) {
                case "qianNode":
                case "houNode":
                    "" != n && -1 == Model.getNodeByName(n) && o.push("该对象不存在，请确认!");
                    break;
                default:
                    o.push("属性不存在，程序错误！")
            }
            return o
        },
        setShapeStatu: function(t, e) {
            t.index >= 0 && t.index < Model.elements.length && Model.elements[t.index].setObjStatu(t.statu, e)
        },
        getShapescopy: function() {
            for (var t = Model.elements,
                     e = [], n = 0; n < t.length; n++) e.push(Utils.copy(t[n]));
            return e
        },
        buildJYJ: function() {
            function r(t, e, n) {
                if (t.wanNode !== e.id) return ! 1;
                var o = t;
                if ( - 1 === o.otherSwitch || -1 === o.otherDoubleCrossover) return ! 1;
                var i = Model.getNodeByID(Model.getIndexByID(o.otherSwitch)),
                    s = Model.getNodeByID(Model.getIndexByID(o.otherDoubleCrossover)),
                    a = Model.getNodeByID(Model.getIndexByID(s.otherSwitch));
                if ( - 1 === o || -1 === i || -1 === s || -1 === a) return ! 1;
                if ("SWITCH" !== s.category || "SWITCH" !== a.category) return ! 1;
                if (s.wanNode !== a.id) return ! 1;
                var h = -1;
                return s.zhiNode === o.id ? h = a: a.zhiNode === o.id && (h = s),
                    -1 == h ? !1 : o.component.chaWan[0].y < h.component.chaWan[0].y ? !0 : !1
            }
            function l(t, e) {
                var n = Model.getNodeByID(Model.getIndexByID(t));
                if ( - 1 === t || -1 === n) return - 1;
                for (var o = !1; ! o;) {
                    if ("TRACK" === n.category || "SWITCH" === n.category) return Model.getNodeByID(Model.getIndexByID(n.id));
                    if ("SIGNAL" !== n.category) return - 1;
                    if (e) {
                        if (n = Model.getNodeByID(Model.getIndexByID(n.houNode)), -1 === n) return - 1
                    } else if (n = Model.getNodeByID(Model.getIndexByID(n.qianNode)), -1 === n) return - 1
                }
            }
            for (var t = Model.elements,
                     e = 0; e < t.length;)"JYJ" === t[e].category ? t.splice(e, 1) : e++;
            for (var e = 0; e < t.length; e++) if ("TRACK" === t[e].category && ("GD" === t[e].trackType || "WCQD" === t[e].trackType || "DCQD" === t[e].trackType)) {
                var n = Utils.copy(metaShape.metaJYJ),
                    o = -1,
                    i = -1;
                t[e].component.point[1].x >= t[e].component.point[0].x ? (i = t[e].component.point[1], o = t[e].component.point[0]) : (i = t[e].component.point[0], o = t[e].component.point[1]);
                var s = !0;
                if ("DCQD" === t[e].trackType) {
                    var a = l(t[e].houNode, !0);
                    "TRACK" === a.category ? t[e].name === a.name && (s = !1) : "SWITCH" === a.category && t[e].name === a.track && (s = !1)
                }
                s && (n.createShape(o, i), t.push(n))
            }
            for (var e = 0; e < t.length; e++) if ("SWITCH" === t[e].category) {
                var o = t[e].component.chaJian[0],
                    i = t[e].component.chaJian[1],
                    h = !0;
                o.x >= i.x && (h = !1);
                var a = l(t[e].qianNode, !h),
                    s = !1;
                if ( - 1 === a ? s = !0 : h ? "SWITCH" !== a.category && "TRACK" !== a.category && (s = !0) : "TRACK" === a.category ? t[e].track !== a.name && (s = !0) : "SWITCH" === a.category ? t[e].track !== a.track && (s = !0) : s = !0, s) {
                    var n = Utils.copy(metaShape.metaJYJ);
                    n.createShape(i, o),
                        t.push(n)
                }
            }
            for (var e = 0; e < t.length; e++) if ("SWITCH" === t[e].category) {
                var o = t[e].component.chaZhi[0],
                    i = t[e].component.chaZhi[1],
                    h = !0;
                o.x >= i.x && (h = !1);
                var a = l(t[e].zhiNode, h),
                    s = !1;
                if ( - 1 === a ? s = !0 : h ? "TRACK" === a.category ? t[e].track !== a.name && (s = !0) : "SWITCH" === a.category ? t[e].track !== a.track && (s = !0) : s = !0 : "SWITCH" !== a.category && "TRACK" !== a.category && (s = !0), s) {
                    var n = Utils.copy(metaShape.metaJYJ);
                    n.createShape(o, i),
                        t.push(n)
                }
            }
            for (var e = 0; e < t.length; e++) if ("SWITCH" === t[e].category) {
                var o = t[e].component.chaWan[0],
                    i = t[e].component.chaWan[1],
                    h = !0;
                o.x >= i.x && (h = !1);
                var a = l(t[e].wanNode, h),
                    s = !1;
                if ( - 1 === a ? s = !0 : h ? "TRACK" === a.category ? t[e].track !== a.name && (s = !0) : "SWITCH" === a.category ? -1 !== t[e].otherDoubleCrossover ? r(t[e], a, h) && (o = {
                            x: t[e].component.chaWan[1].x,
                            y: t[e].component.chaWan[1].y - 1
                        },
                            i = {
                                x: t[e].component.chaWan[1].x,
                                y: t[e].component.chaWan[1].y + 1
                            },
                            s = !0) : t[e].id === a.wanNode ? s = !0 : (t[e].id === a.qianNode || t[e].id === a.houNode) && t[e].track !== a.track && (s = !0) : s = !0 : "SWITCH" !== a.category && "TRACK" !== a.category && (s = !0), s) {
                    var n = Utils.copy(metaShape.metaJYJ);
                    n.createShape(o, i),
                        t.push(n)
                }
            }
        },
        initObj: function(t) {
            var e, n = Model.elements;
            switch (t.category) {
                case "SIGNAL":
                    e = Utils.copy(metaShape.metaSignal),
                        e.category = t.category,
                        e.id = t.id,
                        e.type = t.type,
                        e.name = t.name,
                        e.nameText = t.nameText,
                        e.throat = t.throat,
                        e.qianNode = t.qianNode,
                        e.houNode = t.houNode,
                        e.textPosition.x = t.textPosition.x,
                        e.textPosition.y = t.textPosition.y,
                        e.objPostion.x = t.objPostion.x,
                        e.objPostion.y = t.objPostion.y,
                        e.p1.x = t.p1.x,
                        e.p1.y = t.p1.y,
                        e.p2.x = t.p2.y,
                        e.p2.y = t.p2.y,
                        e.lineWidth = t.lineWidth,
                        e.signalType = t.signalType,
                        e.fangmian = t.fangmian,
                        e.otherSignal = t.otherSignal,
                        e.bingZhi = t.bingZhi,
                        e.chaZhi = t.chaZhi,
                        e.fxbsq = t.fxbsq,
                        e.aspect = t.aspect,
                        e.jg = t.jg,
                        e.dzzd = t.dzzd,
                        e.component.base[0].x = t.component.base[0].x,
                        e.component.base[0].y = t.component.base[0].y,
                        e.component.base[1].x = t.component.base[1].x,
                        e.component.base[1].y = t.component.base[1].y,
                        e.component.pillar[0].x = t.component.pillar[0].x,
                        e.component.pillar[0].y = t.component.pillar[0].y,
                        e.component.pillar[1].x = t.component.pillar[1].x,
                        e.component.pillar[1].y = t.component.pillar[1].y,
                        e.component.firstLight[0].x = t.component.firstLight[0].x,
                        e.component.firstLight[0].y = t.component.firstLight[0].y,
                        e.component.secondLight[0].x = t.component.secondLight[0].x,
                        e.component.secondLight[0].y = t.component.secondLight[0].y;
                    for (var o = 0; o < t.xianshi.length; o++) e.xianshi[o] = t.xianshi[o];
                    for (var o = 0; o < t.button.length; o++) e.button[o] = t.button[o];
                    n.push(e);
                    break;
                case "SWITCH":
                    e = Utils.copy(metaShape.switchObj),
                        e.category = t.category,
                        e.id = t.id,
                        e.type = t.type,
                        e.name = t.name,
                        e.nameText = t.nameText,
                        e.chaXinAngel = t.chaXinAngel,
                        e.track = t.track,
                        e.qianNode = t.qianNode,
                        e.zhiNode = t.zhiNode,
                        e.wanNode = t.wanNode,
                        e.reverse = t.reverse,
                        e.lineWidth = t.lineWidth,
                        e.angel = t.angel,
                        e.textVisible = t.textVisible,
                        e.statu = t.statu,
                        e.throat = t.throat,
                        e.qinXian = t.qinXian,
                        e.component.chaJian[0].x = t.component.chaJian[0].x,
                        e.component.chaJian[0].y = t.component.chaJian[0].y,
                        e.component.chaJian[1].x = t.component.chaJian[1].x,
                        e.component.chaJian[1].y = t.component.chaJian[1].y,
                        e.component.chaZhi[0].x = t.component.chaZhi[0].x,
                        e.component.chaZhi[0].y = t.component.chaZhi[0].y,
                        e.component.chaZhi[1].x = t.component.chaZhi[1].x,
                        e.component.chaZhi[1].y = t.component.chaZhi[1].y,
                        e.component.chaWan[0].x = t.component.chaWan[0].x,
                        e.component.chaWan[0].y = t.component.chaWan[0].y,
                        e.component.chaWan[1].x = t.component.chaWan[1].x,
                        e.component.chaWan[1].y = t.component.chaWan[1].y,
                        e.textPosition.x = t.textPosition.x,
                        e.textPosition.y = t.textPosition.y,
                        e.objPostion.x = t.objPostion.x,
                        e.objPostion.y = t.objPostion.y,
                        e.p1.x = t.p1.x,
                        e.p1.y = t.p1.y,
                        e.p2.x = t.p2.y,
                        e.p2.y = t.p2.y,
                        e.otherSwitch = t.otherSwitch,
                        e.otherDoubleCrossover = t.otherDoubleCrossover,
                        e.extraButton.id = t.extraButton.id,
                        e.extraButton.type = t.extraButton.type,
                        e.extraButton.pos = t.extraButton.pos,
                        n.push(e);
                    break;
                case "TRACK":
                    e = Utils.copy(metaShape.metaTrack),
                        e.category = t.category,
                        e.id = t.id,
                        e.type = t.type,
                        e.name = t.name,
                        e.nameText = t.nameText,
                        e.throat = t.throat,
                        e.qianNode = t.qianNode,
                        e.houNode = t.houNode,
                        e.textPosition.x = t.textPosition.x,
                        e.textPosition.y = t.textPosition.y,
                        e.objPostion.x = t.objPostion.x,
                        e.objPostion.y = t.objPostion.y,
                        e.p1.x = t.p1.x,
                        e.p1.y = t.p1.y,
                        e.p2.x = t.p2.y,
                        e.p2.y = t.p2.y,
                        e.lineWidth = t.lineWidth,
                        e.trackType = t.trackType,
                        e.component.point[0].x = t.component.point[0].x,
                        e.component.point[0].y = t.component.point[0].y,
                        e.component.point[1].x = t.component.point[1].x,
                        e.component.point[1].y = t.component.point[1].y,
                        n.push(e);
                    break;
                case "LIANXI":
                    e = Utils.copy(metaShape.metaLianXi),
                        e.category = t.category,
                        e.id = t.id,
                        e.type = t.type,
                        e.name = t.name,
                        e.nameText = t.nameText,
                        e.textPosition.x = t.textPosition.x,
                        e.textPosition.y = t.textPosition.y,
                        e.objPostion.x = t.objPostion.x,
                        e.objPostion.y = t.objPostion.y,
                        e.lineWidth = t.lineWidth,
                        e.component.point[0].x = t.component.point[0].x,
                        e.component.point[0].y = t.component.point[0].y,
                        n.push(e);
                    break;
                case "TUO_GUI_QI":
                    e = Utils.copy(metaShape.metaTuoGuiQi),
                        e.category = t.category,
                        e.id = t.id,
                        e.type = t.type,
                        e.name = t.name,
                        e.nameText = t.nameText,
                        e.textPosition.x = t.textPosition.x,
                        e.textPosition.y = t.textPosition.y,
                        e.objPostion.x = t.objPostion.x,
                        e.objPostion.y = t.objPostion.y,
                        e.lineWidth = t.lineWidth,
                        e.component.point[0].x = t.component.point[0].x,
                        e.component.point[0].y = t.component.point[0].y,
                        e.component.point[1].x = t.component.point[1].x,
                        e.component.point[1].y = t.component.point[1].y,
                        e.component.point[2].x = t.component.point[2].x,
                        e.component.point[2].y = t.component.point[2].y,
                        n.push(e);
                    break;
                case "QIN_XIAN":
                    e = Utils.copy(metaShape.metaQinXian),
                        e.category = t.category,
                        e.id = t.id,
                        e.type = t.type,
                        e.name = t.name,
                        e.nameText = t.nameText,
                        e.textPosition.x = t.textPosition.x,
                        e.textPosition.y = t.textPosition.y,
                        e.objPostion.x = t.objPostion.x,
                        e.objPostion.y = t.objPostion.y,
                        e.lineWidth = t.lineWidth,
                        e.component.point[0].x = t.component.point[0].x,
                        e.component.point[0].y = t.component.point[0].y,
                        n.push(e);
                    break;
                case "STUB_END_SIDING":
                    e = Utils.copy(metaShape.metaStubEndSinding),
                        e.category = t.category,
                        e.id = t.id,
                        e.type = t.type,
                        e.name = t.name,
                        e.nameText = t.nameText,
                        e.textPosition.x = t.textPosition.x,
                        e.textPosition.y = t.textPosition.y,
                        e.objPostion.x = t.objPostion.x,
                        e.objPostion.y = t.objPostion.y,
                        e.lineWidth = t.lineWidth,
                        e.component.point[0].x = t.component.point[0].x,
                        e.component.point[0].y = t.component.point[0].y,
                        e.component.point[1].x = t.component.point[1].x,
                        e.component.point[1].y = t.component.point[1].y,
                        e.component.point[2].x = t.component.point[2].x,
                        e.component.point[2].y = t.component.point[2].y,
                        e.component.point[3].x = t.component.point[3].x,
                        e.component.point[3].y = t.component.point[3].y,
                        e.component.point[4].x = t.component.point[4].x,
                        e.component.point[4].y = t.component.point[4].y,
                        n.push(e);
                    break;
                case "64D":
                    e = Utils.copy(metaShape.meta64D),
                        e.category = t.category,
                        e.id = t.id,
                        e.type = t.type,
                        e.name = t.name,
                        e.nameText = t.nameText,
                        e.textPosition.x = t.textPosition.x,
                        e.textPosition.y = t.textPosition.y,
                        e.objPostion.x = t.objPostion.x,
                        e.objPostion.y = t.objPostion.y,
                        e.lineWidth = t.lineWidth,
                        e.component.point[0].x = t.component.point[0].x,
                        e.component.point[0].y = t.component.point[0].y,
                        e.component.point[1].x = t.component.point[1].x,
                        e.component.point[1].y = t.component.point[1].y,
                        e.component.point[2].x = t.component.point[2].x,
                        e.component.point[2].y = t.component.point[2].y,
                        e.component.point[3].x = t.component.point[3].x,
                        e.component.point[3].y = t.component.point[3].y,
                        e.component.point[4].x = t.component.point[4].x,
                        e.component.point[4].y = t.component.point[4].y,
                        e.component.point[5].x = t.component.point[5].x,
                        e.component.point[5].y = t.component.point[5].y,
                        e.component.point[6].x = t.component.point[6].x,
                        e.component.point[6].y = t.component.point[6].y,
                        n.push(e);
                    break;
                case "JYJ":
                    e = Utils.copy(metaShape.metaJYJ),
                        e.category = t.category,
                        e.id = t.id,
                        e.type = t.type,
                        e.name = t.name,
                        e.nameText = t.nameText,
                        e.textPosition.x = t.textPosition.x,
                        e.textPosition.y = t.textPosition.y,
                        e.objPostion.x = t.objPostion.x,
                        e.objPostion.y = t.objPostion.y,
                        e.lineWidth = t.lineWidth,
                        e.component.point[0].x = t.component.point[0].x,
                        e.component.point[0].y = t.component.point[0].y,
                        e.component.point[1].x = t.component.point[1].x,
                        e.component.point[1].y = t.component.point[1].y,
                        n.push(e);
                    break;
                case "BUTTON":
                    e = Utils.copy(metaShape.metaButton),
                        e.category = t.category,
                        e.inColor = t.inColor,
                    t.signalIndex && (e.signalIndex = t.signalIndex),
                        e.id = t.id,
                        e.type = t.type,
                        e.name = t.name,
                        e.nameText = t.nameText,
                        e.throat = t.throat,
                        e.qianNode = t.qianNode,
                        e.houNode = t.houNode,
                        e.textPosition.x = t.textPosition.x,
                        e.textPosition.y = t.textPosition.y,
                        e.objPostion.x = t.objPostion.x,
                        e.objPostion.y = t.objPostion.y,
                        e.lineWidth = t.lineWidth,
                        e.buttonType = t.buttonType,
                        e.component.point[0].x = t.component.point[0].x,
                        e.component.point[0].y = t.component.point[0].y,
                        n.push(e);
                    break;
                case "TEXT":
                    e = Utils.copy(metaShape.metaTextShap),
                        e.category = t.category,
                        e.id = t.id,
                        e.type = t.type,
                        e.name = t.name,
                        e.nameText = t.nameText,
                        e.textPosition.x = t.textPosition.x,
                        e.textPosition.y = t.textPosition.y,
                        e.objPostion.x = t.objPostion.x,
                        e.objPostion.y = t.objPostion.y,
                        e.lineWidth = t.lineWidth,
                        e.component.point[0].x = t.component.point[0].x,
                        e.component.point[0].y = t.component.point[0].y,
                        e.component.point[1].x = t.component.point[1].x,
                        e.component.point[1].y = t.component.point[1].y,
                        e.component.point[2].x = t.component.point[2].x,
                        e.component.point[2].y = t.component.point[2].y,
                        e.fontStytle.size = t.fontStytle.size,
                        n.push(e);
                    break;
                case "LINE":
                    e = Utils.copy(metaShape.metaTrack),
                        e.category = t.category,
                        e.id = t.id,
                        e.type = t.type,
                        e.name = t.name,
                        e.nameText = t.nameText,
                        e.throat = t.throat,
                        e.qianNode = t.qianNode,
                        e.houNode = t.houNode,
                        e.textPosition.x = t.textPosition.x,
                        e.textPosition.y = t.textPosition.y,
                        e.objPostion.x = t.objPostion.x,
                        e.objPostion.y = t.objPostion.y,
                        e.p1.x = t.p1.x,
                        e.p1.y = t.p1.y,
                        e.p2.x = t.p2.y,
                        e.p2.y = t.p2.y,
                        e.lineWidth = t.lineWidth,
                        e.trackType = t.trackType,
                        e.component.point[0].x = t.component.point[0].x,
                        e.component.point[0].y = t.component.point[0].y,
                        e.component.point[1].x = t.component.point[1].x,
                        e.component.point[1].y = t.component.point[1].y,
                        n.push(e)
            }
        }
    },
    metaShape = {
        switchObj: {
            id: 0,
            CHA_XIN_X: 3,
            CHA_XIN_Y: 3,
            SWITCH_TRACK_LENGTH: 13.5,
            type: "SHUN_XIANG",
            category: "SWITCH",
            name: "switch",
            nameText: "道岔",
            chaXinAngel: 45,
            track: -1,
            qianNode: -1,
            zhiNode: -1,
            wanNode: -1,
            reverse: "default",
            angel: 0,
            textVisible: !0,
            statu: "DING_WEI",
            throat: "",
            qinXian: "",
            component: {
                chaJian: [{
                    x: 0,
                    y: 0
                },
                    {
                        x: 0,
                        y: 0
                    }],
                chaZhi: [{
                    x: 0,
                    y: 0
                },
                    {
                        x: 0,
                        y: 0
                    }],
                chaWan: [{
                    x: 0,
                    y: 0
                },
                    {
                        x: 0,
                        y: 0
                    }]
            },
            lineWidth: 1.5,
            lineColor: "rgba(0,0,0,1)",
            zhiColor: "rgba(0,0,0,1)",
            wanColor: "rgba(0,0,0,1)",
            lineStytle: "solid",
            fontStytle: {
                fontFamily: "Arial",
                size: 20,
                color: "rgba(150,150,50,1)",
                bold: !1
            },
            textPosition: {
                x: 0,
                y: 5
            },
            objPostion: {
                x: 0,
                y: 0
            },
            p1: {
                x: 0,
                y: 0
            },
            p2: {
                x: 0,
                y: 0
            },
            selected: !1,
            strokeStyle: "rgba(234,43,12,0.3)",
            otherSwitch: -1,
            otherDoubleCrossover: -1,
            OneStatu: !1,
            otherStatu: !1,
            SelectedStatu: !1,
            oneStatuStrokeStytle: "rgba(110,138,55,1)",
            otherStatuStrokeStytle: "rgba(0,255,82,0.8)",
            SelectedStatuStrokeStytle: "rgba(55,38,155,1)",
            extraButton: {
                id: -1,
                type: "",
                name: "BG",
                pos: ""
            },
            setObjStatu: function(t, e) {
                "DEFAULT" == e ? (this.lineColor = Model.page.defaultTrackColor, this.zhiColor = Model.page.defaultTrackColor, this.wanColor = Model.page.defaultTrackColor, this.statu = "DING_WEI") : "SELECTED_P" == e && (this.lineColor = Model.page.trackSelectedColor, "DING_WEI" == t ? this.zhiColor = Model.page.trackSelectedColor: "FAN_WEI" == t && (this.wanColor = Model.page.trackSelectedColor)),
                    "DING_WEI" == t ? this.statu = "DING_WEI": "FAN_WEI" == t ? this.statu = "FAN_WEI": this.statu = t
            },
            createObj: function(t, e, n, o, i, s, a) {
                if (this.name = t, this.nameText = e, this.objPostion.x = s, this.objPostion.y = a, this.type = n, "FAN_XIANG" == n) {
                    this.component.chaJian[0].x = 2 * this.SWITCH_TRACK_LENGTH + this.CHA_XIN_X,
                        this.component.chaJian[0].y = 0,
                        this.component.chaJian[1].x = this.SWITCH_TRACK_LENGTH + this.CHA_XIN_X,
                        this.component.chaJian[1].y = 0,
                        this.component.chaZhi[0].x = this.SWITCH_TRACK_LENGTH,
                        this.component.chaZhi[0].y = 0,
                        this.component.chaZhi[1].x = 0,
                        this.component.chaZhi[1].y = 0;
                    var h = {
                            x: 0,
                            y: 0
                        },
                        r = {
                            x: Math.cos((90 + this.chaXinAngel) * Math.PI / 180) * this.SWITCH_TRACK_LENGTH,
                            y: Math.sin((90 + this.chaXinAngel) * Math.PI / 180) * this.SWITCH_TRACK_LENGTH
                        },
                        l = Utils.getLinePoint( - this.CHA_XIN_X, h, r);
                    this.component.chaWan[0].x = l.x + this.SWITCH_TRACK_LENGTH + this.CHA_XIN_X,
                        this.component.chaWan[0].y = l.y,
                        l = Utils.getLinePoint( - this.SWITCH_TRACK_LENGTH - this.CHA_XIN_X, h, r),
                        this.component.chaWan[1].x = l.x + this.SWITCH_TRACK_LENGTH + this.CHA_XIN_X,
                        this.component.chaWan[1].y = l.y
                } else {
                    this.component.chaJian[0].x = 0,
                        this.component.chaJian[0].y = 0,
                        this.component.chaJian[1].x = this.SWITCH_TRACK_LENGTH,
                        this.component.chaJian[1].y = 0,
                        this.component.chaZhi[0].x = this.SWITCH_TRACK_LENGTH + this.CHA_XIN_X,
                        this.component.chaZhi[0].y = 0,
                        this.component.chaZhi[1].x = 2 * this.SWITCH_TRACK_LENGTH + this.CHA_XIN_X,
                        this.component.chaZhi[1].y = 0;
                    var h = {
                            x: 0,
                            y: 0
                        },
                        r = {
                            x: Math.cos(this.chaXinAngel * Math.PI / 180) * this.SWITCH_TRACK_LENGTH,
                            y: Math.sin(this.chaXinAngel * Math.PI / 180) * this.SWITCH_TRACK_LENGTH
                        },
                        l = Utils.getLinePoint(this.CHA_XIN_X, h, r);
                    this.component.chaWan[0].x = l.x + this.SWITCH_TRACK_LENGTH,
                        this.component.chaWan[0].y = l.y,
                        l = Utils.getLinePoint(this.component.chaZhi[1].x - this.SWITCH_TRACK_LENGTH, h, r),
                        this.component.chaWan[1].x = l.x + this.SWITCH_TRACK_LENGTH,
                        this.component.chaWan[1].y = l.y
                }
                this.calcuRotateAngel(o, 0, 0),
                    this.updateStatu(i)
            },
            updateStatu: function(t) {
                this.statu = t
            },
            calcuRotateAngel: function(t, e, n) {
                this.angel = t,
                this.angel >= 360 && (this.angel = 360),
                    x = this.component.chaJian[0].x,
                    y = this.component.chaJian[0].y,
                    this.component.chaJian[0].x = Math.cos(this.angel * Math.PI / 180) * (x - e) - Math.sin(this.angel * Math.PI / 180) * (y - n) + e,
                    this.component.chaJian[0].y = Math.cos(this.angel * Math.PI / 180) * (y - n) + Math.sin(this.angel * Math.PI / 180) * (x - e) + n,
                    x = this.component.chaJian[1].x,
                    y = this.component.chaJian[1].y,
                    this.component.chaJian[1].x = Math.cos(this.angel * Math.PI / 180) * (x - e) - Math.sin(this.angel * Math.PI / 180) * (y - n) + e,
                    this.component.chaJian[1].y = Math.cos(this.angel * Math.PI / 180) * (y - n) + Math.sin(this.angel * Math.PI / 180) * (x - e) + n,
                    x = this.component.chaZhi[0].x,
                    y = this.component.chaZhi[0].y,
                    this.component.chaZhi[0].x = Math.cos(this.angel * Math.PI / 180) * (x - e) - Math.sin(this.angel * Math.PI / 180) * (y - n) + e,
                    this.component.chaZhi[0].y = Math.cos(this.angel * Math.PI / 180) * (y - n) + Math.sin(this.angel * Math.PI / 180) * (x - e) + n,
                    x = this.component.chaZhi[1].x,
                    y = this.component.chaZhi[1].y,
                    this.component.chaZhi[1].x = Math.cos(this.angel * Math.PI / 180) * (x - e) - Math.sin(this.angel * Math.PI / 180) * (y - n) + e,
                    this.component.chaZhi[1].y = Math.cos(this.angel * Math.PI / 180) * (y - n) + Math.sin(this.angel * Math.PI / 180) * (x - e) + n,
                    x = this.component.chaWan[0].x,
                    y = this.component.chaWan[0].y,
                    this.component.chaWan[0].x = Math.cos(this.angel * Math.PI / 180) * (x - e) - Math.sin(this.angel * Math.PI / 180) * (y - n) + e,
                    this.component.chaWan[0].y = Math.cos(this.angel * Math.PI / 180) * (y - n) + Math.sin(this.angel * Math.PI / 180) * (x - e) + n,
                    x = this.component.chaWan[1].x,
                    y = this.component.chaWan[1].y,
                    this.component.chaWan[1].x = Math.cos(this.angel * Math.PI / 180) * (x - e) - Math.sin(this.angel * Math.PI / 180) * (y - n) + e,
                    this.component.chaWan[1].y = Math.cos(this.angel * Math.PI / 180) * (y - n) + Math.sin(this.angel * Math.PI / 180) * (x - e) + n
            },
            displayMetaShape: function(t, e, n) {
                var o = t.getContext("2d");
                o.save(),
                    o.lineWidth = this.lineWidth,
                    o.lineColor = this.lineColor,
                    o.lineStytle = this.lineStytle,
                    o.lineJoin = "round",
                    o.translate(this.objPostion.x, this.objPostion.y),
                    o.beginPath(),
                    o.moveTo(this.component.chaJian[0].x, this.component.chaJian[0].y),
                    o.lineTo(this.component.chaJian[1].x, this.component.chaJian[1].y),
                    o.moveTo(this.component.chaZhi[0].x, this.component.chaZhi[0].y),
                    o.lineTo(this.component.chaZhi[1].x, this.component.chaZhi[1].y),
                    "FAN_WEI" == this.statu ? (o.moveTo(this.component.chaWan[1].x, this.component.chaWan[1].y), o.lineTo(this.component.chaJian[1].x, this.component.chaJian[1].y)) : "DING_WEI" == this.statu ? (o.moveTo(this.component.chaZhi[0].x, this.component.chaZhi[0].y), o.lineTo(this.component.chaJian[1].x, this.component.chaJian[1].y), o.moveTo(this.component.chaWan[0].x, this.component.chaWan[0].y), o.lineTo(this.component.chaWan[1].x, this.component.chaWan[1].y)) : (o.moveTo(this.component.chaWan[0].x, this.component.chaWan[0].y), o.lineTo(this.component.chaWan[1].x, this.component.chaWan[1].y)),
                    o.stroke(),
                    o.restore()
            },
            showShape: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    this.OneStatu ? e.strokeStyle = this.oneStatuStrokeStytle: this.otherStatu ? e.strokeStyle = this.otherStatuStrokeStytle: this.SelectedStatu ? e.strokeStyle = this.SelectedStatuStrokeStytle: e.strokeStyle = this.lineColor,
                    e.lineWidth = this.lineWidth,
                    e.lineStytle = this.lineStytle,
                    e.lineJoin = "round",
                    e.beginPath(),
                    "FAN_WEI" == this.statu ? (e.moveTo(this.component.chaJian[0].x, this.component.chaJian[0].y), e.lineTo(this.component.chaJian[1].x, this.component.chaJian[1].y), e.moveTo(this.component.chaWan[1].x, this.component.chaWan[1].y), e.lineTo(this.component.chaJian[1].x, this.component.chaJian[1].y), e.stroke(), e.beginPath(), e.save(), e.strokeStyle = this.zhiColor, e.moveTo(this.component.chaZhi[0].x, this.component.chaZhi[0].y), e.lineTo(this.component.chaZhi[1].x, this.component.chaZhi[1].y), e.stroke(), e.restore()) : "DING_WEI" == this.statu ? (e.moveTo(this.component.chaJian[0].x, this.component.chaJian[0].y), e.lineTo(this.component.chaJian[1].x, this.component.chaJian[1].y), e.moveTo(this.component.chaZhi[0].x, this.component.chaZhi[0].y), e.lineTo(this.component.chaZhi[1].x, this.component.chaZhi[1].y), e.moveTo(this.component.chaZhi[0].x, this.component.chaZhi[0].y), e.lineTo(this.component.chaJian[1].x, this.component.chaJian[1].y), e.stroke(), e.beginPath(), e.save(), e.strokeStyle = this.wanColor, e.moveTo(this.component.chaWan[0].x, this.component.chaWan[0].y), e.lineTo(this.component.chaWan[1].x, this.component.chaWan[1].y), e.stroke(), e.restore()) : (e.moveTo(this.component.chaJian[0].x, this.component.chaJian[0].y), e.lineTo(this.component.chaJian[1].x, this.component.chaJian[1].y), e.moveTo(this.component.chaZhi[0].x, this.component.chaZhi[0].y), e.lineTo(this.component.chaZhi[1].x, this.component.chaZhi[1].y), e.moveTo(this.component.chaWan[0].x, this.component.chaWan[0].y), e.lineTo(this.component.chaWan[1].x, this.component.chaWan[1].y), e.stroke()),
                    e.restore(),
                this.selected && this.showSelectedStatu(t),
                    this.showText(t, !0)
            },
            showSelectedStatu: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    e.lineWidth = 1.6 * this.lineWidth,
                    e.strokeStyle = this.strokeStyle,
                    e.lineStytle = this.lineStytle,
                    e.lineJoin = "round",
                    e.beginPath(),
                    e.moveTo(this.component.chaJian[0].x, this.component.chaJian[0].y),
                    e.lineTo(this.component.chaJian[1].x, this.component.chaJian[1].y),
                    e.moveTo(this.component.chaZhi[0].x, this.component.chaZhi[0].y),
                    e.lineTo(this.component.chaZhi[1].x, this.component.chaZhi[1].y),
                    "FAN_WEI" == this.statu ? (e.moveTo(this.component.chaWan[1].x, this.component.chaWan[1].y), e.lineTo(this.component.chaJian[1].x, this.component.chaJian[1].y)) : "DING_WEI" == this.statu ? (e.moveTo(this.component.chaZhi[0].x, this.component.chaZhi[0].y), e.lineTo(this.component.chaJian[1].x, this.component.chaJian[1].y), e.moveTo(this.component.chaWan[0].x, this.component.chaWan[0].y), e.lineTo(this.component.chaWan[1].x, this.component.chaWan[1].y)) : (e.moveTo(this.component.chaWan[0].x, this.component.chaWan[0].y), e.lineTo(this.component.chaWan[1].x, this.component.chaWan[1].y)),
                    e.stroke(),
                    e.restore()
            },
            renderShape: function(t) {
                this.SWITCH_TRACK_LENGTH *= t,
                    this.fontStytle.size *= t,
                    this.CHA_XIN_X *= t,
                    this.CHA_XIN_Y *= t,
                    this.lineWidth *= t,
                    this.component.chaJian[0].x = this.component.chaJian[0].x * t,
                    this.component.chaJian[0].y = this.component.chaJian[0].y * t,
                    this.component.chaJian[1].x = this.component.chaJian[1].x * t,
                    this.component.chaJian[1].y = this.component.chaJian[1].y * t,
                    this.component.chaZhi[0].x = this.component.chaZhi[0].x * t,
                    this.component.chaZhi[0].y = this.component.chaZhi[0].y * t,
                    this.component.chaZhi[1].x = this.component.chaZhi[1].x * t,
                    this.component.chaZhi[1].y = this.component.chaZhi[1].y * t,
                    this.component.chaWan[0].x = this.component.chaWan[0].x * t,
                    this.component.chaWan[0].y = this.component.chaWan[0].y * t,
                    this.component.chaWan[1].x = this.component.chaWan[1].x * t,
                    this.component.chaWan[1].y = this.component.chaWan[1].y * t,
                    this.textPosition.x *= t,
                    this.textPosition.y *= t
            },
            calcuZoomCoordinate: function(t, e, n, o) {
                var i, s;
                i = n / 30,
                    s = i,
                    this.component.chaJian[0].x = this.component.chaJian[0].x * i,
                    this.component.chaJian[0].y = this.component.chaJian[0].y * s,
                    this.component.chaJian[1].x = this.component.chaJian[1].x * i,
                    this.component.chaJian[1].y = this.component.chaJian[1].y * s,
                    this.component.chaZhi[0].x = this.component.chaZhi[0].x * i,
                    this.component.chaZhi[0].y = this.component.chaZhi[0].y * s,
                    this.component.chaZhi[1].x = this.component.chaZhi[1].x * i,
                    this.component.chaZhi[1].y = this.component.chaZhi[1].y * s,
                    this.component.chaWan[0].x = this.component.chaWan[0].x * i,
                    this.component.chaWan[0].y = this.component.chaWan[0].y * s,
                    this.component.chaWan[1].x = this.component.chaWan[1].x * i,
                    this.component.chaWan[1].y = this.component.chaWan[1].y * s
            },
            setBasicPara: function() {
                this.lineWidth = 5,
                    this.calcuZoomCoordinate(0, 0, 80, 80)
            },
            MoveOffset: function(t, e) {
                this.component.chaJian[0].x += t,
                    this.component.chaJian[0].y += e,
                    this.component.chaJian[1].x += t,
                    this.component.chaJian[1].y += e,
                    this.component.chaZhi[0].x += t,
                    this.component.chaZhi[0].y += e,
                    this.component.chaZhi[1].x += t,
                    this.component.chaZhi[1].y += e,
                    this.component.chaWan[0].x += t,
                    this.component.chaWan[0].y += e,
                    this.component.chaWan[1].x += t,
                    this.component.chaWan[1].y += e
            },
            inControlPoint: function(t, e) {
                var n = t.getContext("2d");
                return n.beginPath(),
                    n.arc(this.component.chaJian[0].x, this.component.chaJian[0].y, 8, 0, 2 * Math.PI, !1),
                    n.isPointInPath(e.x, e.y) ? !0 : (n.beginPath(), n.arc(this.component.chaZhi[1].x, this.component.chaZhi[1].y, 8, 0, 2 * Math.PI, !1), n.isPointInPath(e.x, e.y) ? !0 : (n.beginPath(), n.arc(this.component.chaWan[1].x, this.component.chaWan[1].y, 8, 0, 2 * Math.PI, !1), n.isPointInPath(e.x, e.y) ? !0 : !1))
            },
            inRotatePoint: function(t, e) {
                var n = t.getContext("2d"),
                    o = this.getRotatePoint();
                return n.beginPath(),
                    n.arc(o.x, o.y, 5, 0, 2 * Math.PI, !1),
                    n.isPointInPath(e.x, e.y) ? !0 : !1
            },
            getRubberband: function() {
                var t = this.component.chaJian[0].x,
                    e = this.component.chaJian[0].y,
                    n = t,
                    o = e;
                return n > this.component.chaZhi[1].x && (n = this.component.chaZhi[1].x),
                n > this.component.chaWan[1].x && (n = this.component.chaWan[1].x),
                o > this.component.chaZhi[1].y && (o = this.component.chaZhi[1].y),
                o > this.component.chaWan[1].y && (o = this.component.chaWan[1].y),
                t < this.component.chaZhi[1].x && (t = this.component.chaZhi[1].x),
                t < this.component.chaWan[1].x && (t = this.component.chaWan[1].x),
                e < this.component.chaZhi[1].y && (e = this.component.chaZhi[1].y),
                e < this.component.chaWan[1].y && (e = this.component.chaWan[1].y),
                    [n, o, t, e]
            },
            inShape: function(t, e) {
                var n = this.getShapeAngel(this.component.chaJian[0]);
                n = 180 * n / Math.PI;
                var o = Utils.copy(this.component),
                    i = o.chaJian[0],
                    s = Utils.rotateCoordinate(o.chaZhi[1], o.chaJian[0], -n),
                    a = Utils.rotateCoordinate(e, o.chaJian[0], -n),
                    h = [i.x, i.y - 5, s.x, s.y + 5],
                    r = t.getContext("2d");
                if (r.beginPath(), r.rect(h[0], h[1], h[2] - h[0], h[3] - h[1]), r.isPointInPath(a.x, a.y)) return ! 0;
                var l = Utils.rotateCoordinate(o.chaWan[1], o.chaJian[0], -n),
                    p = Utils.rotateCoordinate(o.chaJian[1], o.chaJian[0], -n);
                return n = Math.atan((l.y - p.y) / (l.x - p.x)),
                    n = 180 * n / Math.PI,
                    l = Utils.rotateCoordinate(l, p, -n),
                    a = Utils.rotateCoordinate(a, p, -n),
                    h = [p.x, p.y - 5, l.x, l.y + 5],
                    r = t.getContext("2d"),
                    r.beginPath(),
                    r.rect(h[0], h[1], h[2] - h[0], h[3] - h[1]),
                    r.isPointInPath(a.x, a.y) ? !0 : !1
            },
            getControlPoints: function() {
                var t = [this.component.chaJian[0], this.component.chaWan[1], this.component.chaZhi[1]];
                return t
            },
            getRotatePoint: function() {
                return this.component.chaZhi[0]
            },
            getRotateCoordinatePoint: function() {
                return this.component.chaJian[0]
            },
            inPoint: function(t, e, n) {
                var o = t.getContext("2d"),
                    i = e;
                return o.beginPath(),
                    o.arc(i.x, i.y, 8, 0, 2 * Math.PI, !1),
                    o.isPointInPath(n.x, n.y) ? !0 : !1
            },
            setControlPoint: function(t, e) {
                if (this.inPoint(t, this.component.chaJian[0], e)) this.p1 = this.component.chaJian[0],
                    this.p2 = this.component.chaJian[1];
                else if (this.inPoint(t, this.component.chaZhi[1], e)) this.p1 = this.component.chaZhi[1],
                    this.p2 = this.component.chaZhi[0];
                else {
                    if (!this.inPoint(t, this.component.chaWan[1], e)) return ! 1;
                    this.p1 = this.component.chaWan[1],
                        this.p2 = this.component.chaZhi[0]
                }
            },
            scratchShape: function(t, e) {
                var n, o, i;
                n = this.p1,
                    o = this.p2;
                var h = Math.atan((n.y - o.y) / (n.x - o.x));
                h = 180 * h / Math.PI,
                    Math.abs(h) > 70 ? (h = -h, i = Utils.rotateCoordinate(n, o, h), p = Utils.rotateCoordinate(e, o, h), p = Utils.getLinePoint(p.x, i, o), p = Utils.rotateCoordinate(p, o, -h)) : p = Utils.getLinePoint(e.x, n, o),
                    h = Math.atan((this.component.chaJian[0].y - this.component.chaJian[1].y) / (this.component.chaJian[0].x - this.component.chaJian[1].x)),
                    h = 180 * h / Math.PI;
                var r = Utils.copy(n),
                    l = Utils.copy(o),
                    c = Utils.copy(p);
                if (r = Utils.rotateCoordinate(r, this.component.chaJian[0], -h), l = Utils.rotateCoordinate(l, this.component.chaJian[0], -h), c = Utils.rotateCoordinate(p, this.component.chaJian[0], -h), this.inPoint(t, this.component.chaJian[0], n)) {
                    if ("SHUN_XIANG" == this.type) {
                        if (r.x > l.x) {
                            if (c.x < l.x) return ! 1
                        } else if (c.x > l.x) return ! 1
                    } else if (r.x > l.x) {
                        if (c.x < l.x) return ! 1
                    } else if (c.x > l.x) return ! 1
                } else if (this.inPoint(t, this.component.chaZhi[1], n)) {
                    if ("SHUN_XIANG" == this.type) {
                        if (r.x > l.x) {
                            if (c.x < l.x) return ! 1
                        } else if (c.x > l.x) return ! 1
                    } else if (r.x > l.x) {
                        if (c.x < l.x) return ! 1
                    } else if (c.x > l.x) return ! 1
                } else {
                    if (!this.inPoint(t, this.component.chaWan[1], n)) return ! 1;
                    if ("SHUN_XIANG" == this.type) {
                        if (r.y > l.y) {
                            if (c.y < l.y) return ! 1
                        } else if (c.y > l.y) return ! 1
                    } else if (r.y > l.y) {
                        if (c.y < l.y) return ! 1
                    } else if (c.y > l.y) return ! 1
                }
                return this.inPoint(t, this.component.chaZhi[0], p) || this.inPoint(t, this.component.chaJian[1], p) || this.inPoint(t, this.component.chaWan[0], p) ? !1 : (n.x = p.x, void(n.y = p.y))
            },
            getShapeAngel: function(t) {
                var e = -90;
                return e = Math.atan((this.component.chaJian[1].y - t.y) / (this.component.chaJian[1].x - t.x))
            },
            changeChaWanAngel: function(t, e) {
                var n = this.getShapeAngel(this.component.chaJian[0]);
                n = 180 * n / Math.PI,
                    this.calcuRotateAngel( - n, this.component.chaJian[0].x, this.component.chaJian[0].y);
                var o = Math.atan((this.component.chaWan[1].y - this.component.chaJian[1].y) / (this.component.chaWan[1].x - this.component.chaJian[1].x));
                if (o = 180 * o / Math.PI, 0 > o && (e = -e), o = e - o, Math.abs(o) > 88 || Math.abs(o) < 3) return void this.calcuRotateAngel(n, this.component.chaJian[0].x, this.component.chaJian[0].y);
                var i = {
                    x: 0,
                    y: 0
                };
                i = Utils.rotateCoordinate(this.component.chaWan[1], this.component.chaJian[1], o),
                    this.component.chaWan[1].x = i.x,
                    this.component.chaWan[1].y = i.y,
                    i = Utils.rotateCoordinate(this.component.chaWan[0], this.component.chaJian[1], o),
                    this.component.chaWan[0].x = i.x,
                    this.component.chaWan[0].y = i.y,
                    this.calcuRotateAngel(n, this.component.chaJian[0].x, this.component.chaJian[0].y)
            },
            updateTextPostion: function() {
                var t, n, e = {
                        x: 0,
                        y: 0
                    },
                    o = this.getShapeAngel(this.component.chaJian[0]);
                o = 180 * o / Math.PI,
                    t = Utils.copy(this.component.chaJian[1]),
                    n = Utils.copy(this.component.chaWan[0]),
                    n = Utils.rotateCoordinate(n, t, -o),
                    n.y > t.y ? e.y = t.y - this.fontStytle.size: e.y = t.y + this.fontStytle.size,
                    e.x = t.x,
                    e = Utils.rotateCoordinate(e, t, o),
                    this.textPosition.x = e.x,
                    this.textPosition.y = e.y
            },
            showText: function(t, e) {
                if (this.updateTextPostion(), e) {
                    var n = t.getContext("2d");
                    n.save(),
                        n.font = this.fontStytle.size + "px " + this.fontStytle.fontFamily,
                        n.textBaseline = "middle",
                        n.textAlign = "center",
                        n.fillStyle = this.fontStytle.color,
                        n.strokeStyle = this.fontStytle.color,
                        n.fillText(this.name, this.textPosition.x, this.textPosition.y),
                        n.restore()
                }
            }
        },
        metaTrack: {
            id: 0,
            TRACK_LENGTH: 27,
            type: "WG",
            category: "TRACK",
            name: "track",
            nameText: "区段",
            textVisible: !0,
            selected: !1,
            strokeStyle: "rgba(234,43,12,0.3)",
            throat: "",
            qianNode: -1,
            houNode: -1,
            trackType: "GD",
            component: {
                point: [{
                    x: 0,
                    y: 0
                },
                    {
                        x: 0,
                        y: 0
                    }]
            },
            lineWidth: 1.5,
            lineColor: "250,250,250",
            lineStytle: "solid",
            fontStytle: {
                fontFamily: "Arial",
                size: 20,
                color: "rgba(150,150,50,1)",
                bold: !1
            },
            textPosition: {
                x: 0,
                y: 5
            },
            objPostion: {
                x: 0,
                y: 0
            },
            p1: {
                x: 0,
                y: 0
            },
            p2: {
                x: 0,
                y: 0
            },
            setObjStatu: function(t, e) {
                "DEFAULT" == e ? this.lineColor = Model.page.defaultTrackColor: "SELECTED_P" == e && (this.lineColor = Model.page.trackSelectedColor)
            },
            createObj: function(t, e, n, o, i, s) {
                this.name = t,
                    this.nameText = e,
                    this.objPostion.x = i,
                    this.objPostion.y = s,
                    this.type = n,
                    this.category = o,
                    this.component.point[0].x = 0,
                    this.component.point[0].y = 0,
                    this.component.point[1].x = this.TRACK_LENGTH,
                    this.component.point[1].y = 0
            },
            displayMetaShape: function(t, e, n) {
                var o = t.getContext("2d");
                o.save(),
                    o.lineWidth = this.lineWidth,
                    o.lineColor = this.lineColor,
                    o.lineStytle = this.lineStytle,
                    o.lineJoin = "round",
                    o.translate(this.objPostion.x, this.objPostion.y),
                    o.beginPath(),
                    o.moveTo(this.component.point[0].x, this.component.point[0].y),
                    o.lineTo(this.component.point[1].x, this.component.point[1].y),
                    o.stroke(),
                    o.restore()
            },
            renderShape: function(t) {
                this.TRACK_LENGTH *= t,
                    this.lineWidth *= t,
                    this.fontStytle.size *= t,
                    this.component.point[0].x = this.component.point[0].x * t,
                    this.component.point[0].y = this.component.point[0].y * t,
                    this.component.point[1].x = this.component.point[1].x * t,
                    this.component.point[1].y = this.component.point[1].y * t,
                    this.textPosition.x *= t,
                    this.textPosition.y *= t
            },
            calcuZoomCoordinate: function(t, e, n, o) {
                var i, s;
                i = n / 30,
                    s = i,
                    this.component.point[0].x = this.component.point[0].x * i,
                    this.component.point[0].y = this.component.point[0].y * s,
                    this.component.point[1].x = this.component.point[1].x * i,
                    this.component.point[1].y = this.component.point[1].y * s
            },
            setBasicPara: function() {
                this.lineWidth = 5,
                    this.calcuZoomCoordinate(0, 0, 80, 80)
            },
            MoveOffset: function(t, e) {
                this.component.point[0].x += t,
                    this.component.point[0].y += e,
                    this.component.point[1].x += t,
                    this.component.point[1].y += e
            },
            showShape: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    e.lineWidth = this.lineWidth,
                    e.strokeStyle = this.lineColor,
                    e.lineStytle = this.lineStytle,
                    e.lineJoin = "round",
                    e.beginPath(),
                    e.moveTo(this.component.point[0].x, this.component.point[0].y),
                    e.lineTo(this.component.point[1].x, this.component.point[1].y),
                    e.stroke(),
                    e.restore(),
                this.selected && this.showSelectedStatu(t),
                    this.showText(t, !0)
            },
            showSelectedStatu: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    e.lineWidth = 1.6 * this.lineWidth,
                    e.strokeStyle = this.strokeStyle,
                    e.lineStytle = this.lineStytle,
                    e.lineJoin = "round",
                    e.beginPath(),
                    e.moveTo(this.component.point[0].x, this.component.point[0].y),
                    e.lineTo(this.component.point[1].x, this.component.point[1].y),
                    e.stroke(),
                    e.restore()
            },
            inRotatePoint: function(t, e) {
                return ! 1
            },
            inControlPoint: function(t, e) {
                var n = t.getContext("2d");
                return n.beginPath(),
                    n.arc(this.component.point[0].x, this.component.point[0].y, 8, 0, 2 * Math.PI, !1),
                    n.isPointInPath(e.x, e.y) ? !0 : (n.beginPath(), n.arc(this.component.point[1].x, this.component.point[1].y, 8, 0, 2 * Math.PI, !1), n.isPointInPath(e.x, e.y) ? !0 : !1)
            },
            inPoint: function(t, e, n) {
                var o = t.getContext("2d"),
                    i = e;
                return o.beginPath(),
                    o.arc(i.x, i.y, 8, 0, 2 * Math.PI, !1),
                    o.isPointInPath(n.x, n.y) ? !0 : !1
            },
            setControlPoint: function(t, e) {
                if (this.inPoint(t, this.component.point[0], e)) this.p1 = this.component.point[0],
                    this.p2 = this.component.point[1];
                else {
                    if (!this.inPoint(t, this.component.point[1], e)) return ! 1;
                    this.p1 = this.component.point[1],
                        this.p2 = this.component.point[0]
                }
            },
            inShape: function(t, e) {
                var n = Utils.copy(this.component.point[1]),
                    o = Utils.copy(this.component.point[0]),
                    i = Utils.calcuAngel(n, o);
                i = 180 * i / Math.PI;
                var s = Utils.rotateCoordinate(n, o, -i),
                    a = Utils.rotateCoordinate(e, o, -i),
                    h = [o.x, o.y - 5, s.x, s.y + 5],
                    r = t.getContext("2d");
                return r.beginPath(),
                    r.rect(h[0], h[1], h[2] - h[0], h[3] - h[1]),
                    r.isPointInPath(a.x, a.y) ? !0 : !1
            },
            getControlPoints: function() {
                var t = [this.component.point[0], this.component.point[1]];
                return t
            },
            getRotatePoint: function() {
                return ! 1
            },
            scratchShape: function(t, e) {
                this.p1.x = e.x,
                    this.p1.y = e.y,
                Math.abs(this.p1.y - this.p2.y) < 5 && (this.p1.y = this.p2.y),
                Math.abs(this.p1.x - this.p2.x) < 5 && (this.p1.x = this.p2.x)
            },
            updateTextPostion: function() {
                var t, n;
                t = this.component.point[0],
                    n = this.component.point[1],
                    this.textPosition.x = (t.x + n.x) / 2,
                    this.textPosition.y = (t.y + n.y) / 2 - this.fontStytle.size
            },
            showText: function(t, e) {
                if ("DCQD" != this.trackType && (this.updateTextPostion(), e)) {
                    var n = t.getContext("2d");
                    n.save(),
                        n.font = this.fontStytle.size + "px " + this.fontStytle.fontFamily,
                        n.textBaseline = "middle",
                        n.textAlign = "center",
                        n.fillStyle = this.fontStytle.color,
                        n.strokeStyle = this.fontStytle.color,
                        n.fillText(this.name, this.textPosition.x, this.textPosition.y),
                        n.restore()
                }
            }
        },
        metaSignal: {
            id: 0,
            RADIUS: 8,
            type: "DIAO_G",
            signalType: "",
            fangmian: "",
            category: "SIGNAL",
            name: "diaoche",
            nameText: "调车-高柱",
            textVisible: !0,
            selected: !1,
            strokeStyle: "rgba(234,43,12,0.3)",
            otherSignal: -1,
            bingZhi: !1,
            chaZhi: !1,
            throat: "",
            qianNode: -1,
            houNode: -1,
            xianshi: [],
            button: [],
            fxbsq: "",
            aspect: "",
            jg: -1,
            dzzd: !1,
            component: {
                base: [{
                    x: 0,
                    y: 0
                },
                    {
                        x: 16,
                        y: 0
                    }],
                pillar: [{
                    x: 0,
                    y: 8
                },
                    {
                        x: 8,
                        y: 8
                    }],
                firstLight: [{
                    x: 16,
                    y: 8
                }],
                secondLight: [{
                    x: 40,
                    y: 8
                }]
            },
            lineWidth: 2.5,
            lineColor: "250,250,250",
            lineStytle: "solid",
            fontStytle: {
                fontFamily: "Arial",
                size: 20,
                color: "rgba(150,150,50,1)",
                bold: !1
            },
            textPosition: {
                x: 0,
                y: 5
            },
            objPostion: {
                x: 0,
                y: 0
            },
            p1: {
                x: 0,
                y: 0
            },
            p2: {
                x: 0,
                y: 0
            },
            setObjStatu: function(t, e) {},
            createObj: function(t, e, n, o, i, s) {
                function l(t) {
                    "LIE" == t.type.match("LIE") ? (t.signalType = "JZ", t.xianshi = ["L", "LU"], t.button = ["LBUTTON"], t.fxbsq = "WUFANGXIANG") : (t.signalType = "DC", t.xianshi[0] = "DB", t.button = ["DBUTTON"], t.fxbsq = "")
                }
                this.name = t,
                    this.nameText = e,
                    this.objPostion.x = i,
                    this.objPostion.y = s,
                    this.type = n;
                var h, r, a = this.component;
                a.base[0].x = 0,
                    a.base[0].y = 0,
                    a.base[1].x = 0,
                    a.base[1].y = 2 * this.RADIUS,
                    a.pillar[0].x = 0,
                    a.pillar[0].y = this.RADIUS,
                    "LIE_G" == n || "DIAO_G" == n ? (a.pillar[1].x = this.RADIUS, a.pillar[1].y = this.RADIUS, a.firstLight[0].x = 2 * this.RADIUS + .5, a.firstLight[0].y = this.RADIUS, h = 3 * this.RADIUS, r = this.RADIUS, "LIE_G" == n && (a.secondLight[0].x = 4 * this.RADIUS + 3, a.secondLight[0].y = this.RADIUS, h = 5 * this.RADIUS, r = this.RADIUS)) : (a.firstLight[0].x = this.RADIUS + 3, a.firstLight[0].y = this.RADIUS, h = 2 * this.RADIUS, r = this.RADIUS, "LIE_A" == n && (a.secondLight[0].x = 3 * this.RADIUS + 5, a.secondLight[0].y = this.RADIUS, h = 2 * this.RADIUS, r = this.RADIUS)),
                    this.calcuRotateAngel(o, h, r),
                    l(this)
            },
            displayMetaShape: function(t, e, n) {
                var o = t.getContext("2d"),
                    i = this.component;
                o.save(),
                    o.lineWidth = this.lineWidth,
                    o.lineColor = this.lineColor,
                    o.lineStytle = this.lineStytle,
                    o.lineJoin = "round",
                    o.translate(this.objPostion.x, this.objPostion.y),
                    o.scale(.66, .66),
                    o.beginPath(),
                    o.moveTo(i.base[0].x, i.base[0].y),
                    o.lineTo(i.base[1].x, i.base[1].y),
                    o.stroke(),
                    "LIE_G" == this.type || "DIAO_G" == this.type ? (o.beginPath(), o.moveTo(i.pillar[0].x, i.pillar[0].y), o.lineTo(i.pillar[1].x, i.pillar[1].y), o.stroke(), "LIE_G" == this.type ? (o.beginPath(), o.save(), o.fillStyle = "rgba(255, 0, 0, 1)", o.lineWidth = this.lineWidth * (2.5 / 3.5), o.arc(i.firstLight[0].x, i.firstLight[0].y, this.RADIUS, 0, 2 * Math.PI, !1), o.stroke(), o.fill(), o.restore(), o.beginPath(), o.save(), o.fillStyle = "rgba(255, 255, 255, 1)", o.lineWidth = this.lineWidth * (2.5 / 3.5), o.arc(i.secondLight[0].x, i.secondLight[0].y, this.RADIUS, 0, 2 * Math.PI, !1), o.stroke(), o.fill(), o.restore()) : (o.beginPath(), o.save(), o.fillStyle = "rgba(0, 0, 255, 1)", o.lineWidth = this.lineWidth * (2.5 / 3.5), o.arc(i.firstLight[0].x, i.firstLight[0].y, this.RADIUS, 0, 2 * Math.PI, !1), o.stroke(), o.fill(), o.restore())) : "LIE_A" == this.type ? (o.save(), o.beginPath(), o.fillStyle = "rgba(255, 0, 0, 1)", o.lineWidth = this.lineWidth * (2.5 / 3.5), o.arc(i.firstLight[0].x, i.firstLight[0].y, this.RADIUS, 0, 2 * Math.PI, !1), o.stroke(), o.fill(), o.beginPath(), o.fillStyle = "rgba(255, 255, 255, 1)", o.arc(i.secondLight[0].x, i.secondLight[0].y, this.RADIUS, 0, 2 * Math.PI, !1), o.stroke(), o.fill(), o.restore()) : (o.save(), o.beginPath(), o.lineWidth = this.lineWidth * (2.5 / 3.5), o.fillStyle = "rgba(0, 0, 255, 1)", o.arc(i.firstLight[0].x, i.firstLight[0].y, this.RADIUS, 0, 2 * Math.PI, !1), o.stroke(), o.fill(), o.restore()),
                    o.restore()
            },
            setBasicPara: function() {
                var t, e;
                this.lineWidth = 3.5,
                    "lie_gf" == this.name ? (t = this.objPostion.x + 12 * this.RADIUS, e = this.objPostion.y) : "diao_gf" == this.name ? (t = this.objPostion.x + 6 * this.RADIUS, e = this.objPostion.y) : "lie_af" == this.name ? (t = this.objPostion.x + 2 * this.RADIUS, e = this.objPostion.y) : "diao_af" == this.name ? (t = this.objPostion.x + 3 * this.RADIUS, e = this.objPostion.y) : (t = this.objPostion.x + .5 * this.RADIUS, e = this.objPostion.y),
                    this.MoveOffset( - t, -e)
            },
            renderShape: function(t) {
                var e = this.component;
                this.fontStytle.size *= t,
                    e.base[0].x *= t,
                    e.base[0].y *= t,
                    e.base[1].x *= t,
                    e.base[1].y *= t,
                    e.pillar[0].x *= t,
                    e.pillar[0].y *= t,
                    e.pillar[1].x *= t,
                    e.pillar[1].y *= t,
                    e.firstLight[0].x *= t,
                    e.firstLight[0].y *= t,
                    e.secondLight[0].x *= t,
                    e.secondLight[0].y *= t,
                    this.lineWidth *= t,
                    this.RADIUS *= t,
                    this.textPosition.x *= t,
                    this.textPosition.y *= t
            },
            MoveOffset: function(t, e) {
                var n = this.component;
                n.base[0].x += t,
                    n.base[0].y += e,
                    n.base[1].x += t,
                    n.base[1].y += e,
                    n.pillar[0].x += t,
                    n.pillar[0].y += e,
                    n.pillar[1].x += t,
                    n.pillar[1].y += e,
                    n.firstLight[0].x += t,
                    n.firstLight[0].y += e,
                    n.secondLight[0].x += t,
                    n.secondLight[0].y += e
            },
            showShape: function(t) {
                var e = t.getContext("2d"),
                    n = this.component;
                e.save(),
                    e.lineWidth = this.lineWidth,
                    e.lineColor = this.lineColor,
                    e.lineStytle = this.lineStytle,
                    e.lineJoin = "round",
                    e.beginPath(),
                    e.moveTo(n.base[0].x, n.base[0].y),
                    e.lineTo(n.base[1].x, n.base[1].y),
                    e.stroke(),
                    "LIE_G" == this.type || "DIAO_G" == this.type ? (e.beginPath(), e.moveTo(n.pillar[0].x, n.pillar[0].y), e.lineTo(n.pillar[1].x, n.pillar[1].y), e.stroke(), "LIE_G" == this.type ? (e.beginPath(), e.save(), e.fillStyle = "rgba(255, 0, 0, 1)", e.lineWidth = this.lineWidth * (2.5 / 3.5), e.arc(n.firstLight[0].x, n.firstLight[0].y, this.RADIUS, 0, 2 * Math.PI, !1), e.stroke(), e.fill(), e.restore(), e.beginPath(), e.save(), e.fillStyle = "rgba(255, 255, 255, 1)", e.lineWidth = this.lineWidth * (2.5 / 3.5), e.arc(n.secondLight[0].x, n.secondLight[0].y, this.RADIUS, 0, 2 * Math.PI, !1), e.stroke(), e.fill(), e.restore()) : (e.beginPath(), e.save(), e.fillStyle = "rgba(0, 0, 255, 1)", e.lineWidth = this.lineWidth * (2.5 / 3.5), e.arc(n.firstLight[0].x, n.firstLight[0].y, this.RADIUS, 0, 2 * Math.PI, !1), e.stroke(), e.fill(), e.restore())) : "LIE_A" == this.type ? (e.save(), e.beginPath(), e.fillStyle = "rgba(255, 0, 0, 1)", e.lineWidth = this.lineWidth * (2.5 / 3.5), e.arc(n.firstLight[0].x, n.firstLight[0].y, this.RADIUS, 0, 2 * Math.PI, !1), e.stroke(), e.fill(), e.beginPath(), e.fillStyle = "rgba(255, 255, 255, 1)", e.arc(n.secondLight[0].x, n.secondLight[0].y, this.RADIUS, 0, 2 * Math.PI, !1), e.stroke(), e.fill(), e.restore()) : (e.save(), e.beginPath(), e.lineWidth = this.lineWidth * (2.5 / 3.5), e.fillStyle = "rgba(0, 0, 255, 1)", e.arc(n.firstLight[0].x, n.firstLight[0].y, this.RADIUS, 0, 2 * Math.PI, !1), e.stroke(), e.fill(), e.restore()),
                    e.restore(),
                this.selected && this.showSelectedStatu(t),
                    this.showText(t, !0)
            },
            showSelectedStatu: function(t) {
                var e = t.getContext("2d"),
                    n = this.component;
                e.save(),
                    e.lineWidth = this.lineWidth,
                    e.strokeStyle = this.strokeStyle,
                    e.lineStytle = 1.6 * this.lineStytle,
                    e.lineJoin = "round",
                    e.beginPath(),
                    e.moveTo(n.base[0].x, n.base[0].y),
                    e.lineTo(n.base[1].x, n.base[1].y),
                    e.stroke(),
                    "LIE_G" == this.type || "DIAO_G" == this.type ? (e.beginPath(), e.moveTo(n.pillar[0].x, n.pillar[0].y), e.lineTo(n.pillar[1].x, n.pillar[1].y), e.stroke(), "LIE_G" == this.type ? (e.beginPath(), e.save(), e.lineWidth = 1.6 * this.lineWidth, e.arc(n.firstLight[0].x, n.firstLight[0].y, 1.2 * this.RADIUS, 0, 2 * Math.PI, !1), e.stroke(), e.restore(), e.beginPath(), e.save(), e.lineWidth = 1.6 * this.lineWidth, e.arc(n.secondLight[0].x, n.secondLight[0].y, 1.2 * this.RADIUS, 0, 2 * Math.PI, !1), e.stroke(), e.restore()) : (e.beginPath(), e.save(), e.lineWidth = 1.6 * this.lineWidth, e.arc(n.firstLight[0].x, n.firstLight[0].y, 1.2 * this.RADIUS, 0, 2 * Math.PI, !1), e.stroke(), e.restore())) : "LIE_A" == this.type ? (e.save(), e.beginPath(), e.lineWidth = 1.6 * this.lineWidth, e.arc(n.firstLight[0].x, n.firstLight[0].y, 1.2 * this.RADIUS, 0, 2 * Math.PI, !1), e.stroke(), e.beginPath(), e.arc(n.secondLight[0].x, n.secondLight[0].y, 1.2 * this.RADIUS, 0, 2 * Math.PI, !1), e.stroke(), e.restore()) : (e.save(), e.beginPath(), e.lineWidth = 1.6 * this.lineWidth, e.arc(n.firstLight[0].x, n.firstLight[0].y, 1.2 * this.RADIUS, 0, 2 * Math.PI, !1), e.stroke(), e.restore()),
                    e.restore()
            },
            inRotatePoint: function(t, e) {
                return Utils.inPoint(t, e, this.getRotatePoint()) ? !0 : !1
            },
            inControlPoint: function(t, e) {
                return ! 1
            },
            setControlPoint: function(t, e) {
                return ! 1
            },
            getRotateCoordinatePoint: function() {
                var e, n, t = {
                        x: 0,
                        y: 0
                    },
                    o = Utils.copy(this.component.pillar[0]),
                    i = Utils.copy(this.component.firstLight[0]),
                    s = Utils.calcuAngel(i, o);
                return s = 180 * s / Math.PI,
                    i = Utils.rotateCoordinate(i, o, -s),
                    "LIE_G" == this.type || "LIE_A" == this.type ? i.x - o.x > 0 ? (e = i.x + 3 * this.RADIUS, n = i.y) : (e = i.x - 3 * this.RADIUS, n = i.y) : ("DIAO_G" == this.type || "DIAO_A" == this.type) && (i.x - o.x > 0 ? (e = i.x + this.RADIUS, n = i.y) : (e = i.x - this.RADIUS, n = i.y)),
                    t.x = e,
                    t.y = n,
                    t = Utils.rotateCoordinate(t, o, s)
            },
            inShape: function(t, e) {
                var n = Utils.copy(this.component.pillar[0]),
                    o = this.getRotateCoordinatePoint(),
                    i = Utils.calcuAngel(o, n);
                i = 180 * i / Math.PI;
                var s = Utils.rotateCoordinate(o, n, -i),
                    a = Utils.rotateCoordinate(e, n, -i),
                    h = [n.x, n.y - this.RADIUS, s.x, s.y + this.RADIUS],
                    r = t.getContext("2d");
                return r.beginPath(),
                    r.rect(h[0], h[1], h[2] - h[0], h[3] - h[1]),
                    r.isPointInPath(a.x, a.y) ? !0 : !1
            },
            getControlPoints: function() {
                return ! 1
            },
            getRotatePoint: function() {
                return this.component.pillar[0]
            },
            scratchShape: function(t, e) {
                this.p1.x = e.x,
                    this.p1.y = e.y
            },
            calcuRotateAngel: function(t, e, n) {
                var o = {
                        x: e,
                        y: n
                    },
                    i = this.component;
                this.angel = t,
                this.angel >= 360 && (this.angel = 360);
                var s = Utils.rotateCoordinate(i.base[0], o, t);
                i.base[0].x = s.x,
                    i.base[0].y = s.y,
                    s = Utils.rotateCoordinate(i.base[1], o, t),
                    i.base[1].x = s.x,
                    i.base[1].y = s.y,
                    s = Utils.rotateCoordinate(i.pillar[0], o, t),
                    i.pillar[0].x = s.x,
                    i.pillar[0].y = s.y,
                    s = Utils.rotateCoordinate(i.pillar[1], o, t),
                    i.pillar[1].x = s.x,
                    i.pillar[1].y = s.y,
                    s = Utils.rotateCoordinate(i.firstLight[0], o, t),
                    i.firstLight[0].x = s.x,
                    i.firstLight[0].y = s.y,
                    s = Utils.rotateCoordinate(i.secondLight[0], o, t),
                    i.secondLight[0].x = s.x,
                    i.secondLight[0].y = s.y
            },
            getShapeAngel: function(t) {
                var e = -90;
                return e = Utils.calcuAngel(this.component.pillar[0], t)
            },
            updateTextPostion: function() {
                var t, n, e = {
                    x: 0,
                    y: 0
                };
                t = this.component.pillar[0],
                    n = this.component.firstLight[0];
                var o = Utils.calcuAngel(t, n);
                o = 180 * o / Math.PI,
                    0 != o ? (e = Utils.rotateCoordinate(t, n, -o), e.x < t.x ? (e.y = e.y - this.fontStytle.size, e = Utils.rotateCoordinate(e, t, o)) : (e.y = e.y + this.fontStytle.size, e = Utils.rotateCoordinate(e, t, o))) : t.x < n.x ? (e.x = t.x, e.y = t.y - this.fontStytle.size) : (e.x = t.x, e.y = t.y + this.fontStytle.size),
                    this.textPosition.x = e.x,
                    this.textPosition.y = e.y
            },
            showText: function(t, e) {
                if (this.updateTextPostion(), e) {
                    var n = t.getContext("2d");
                    n.save(),
                        n.font = this.fontStytle.size + "px " + this.fontStytle.fontFamily,
                        n.textBaseline = "middle",
                        n.textAlign = "center",
                        n.fillStyle = this.fontStytle.color,
                        n.strokeStyle = this.fontStytle.color,
                        n.fillText(this.name, this.textPosition.x, this.textPosition.y),
                        n.restore()
                }
            }
        },
        metaLianXi: {
            id: 0,
            RADIUS: 5,
            type: "ZHAO_CHA",
            category: "LIANXI",
            name: "zhao_cha",
            nameText: "照查",
            textVisible: !0,
            selected: !1,
            strokeStyle: "rgba(234,43,12,0.3)",
            component: {
                point: [{
                    x: 0,
                    y: 0
                }]
            },
            lineWidth: 1.5,
            lineColor: "250,250,250",
            lineStytle: "solid",
            fontStytle: {
                fontFamily: "Arial",
                size: 13,
                color: "rgba(150,150,50,1)",
                bold: !1
            },
            textPosition: {
                x: 0,
                y: 5
            },
            objPostion: {
                x: 0,
                y: 0
            },
            setObjStatu: function(t, e) {},
            createObj: function(t, e, n, o, i) {
                this.name = t,
                    this.nameText = e,
                    this.objPostion.x = o,
                    this.objPostion.y = i,
                    this.type = n,
                    this.component.point[0].x = 0,
                    this.component.point[0].y = 0
            },
            displayMetaShape: function(t, e, n) {
                var o = t.getContext("2d");
                o.save(),
                    o.lineWidth = this.lineWidth,
                    o.lineColor = this.lineColor,
                    o.lineStytle = this.lineStytle,
                    o.lineJoin = "round",
                    o.fillStyle = "rgba(255, 0, 0, 1)",
                    o.translate(this.objPostion.x, this.objPostion.y),
                    o.scale(1.5, 1.5),
                    o.beginPath(),
                    o.arc(this.component.point[0].x, this.component.point[0].y, this.RADIUS, 0, 2 * Math.PI, !1),
                    o.stroke(),
                    o.fill(),
                    o.restore()
            },
            renderShape: function(t) {
                this.fontStytle.size *= t,
                    this.component.point[0].x *= t,
                    this.component.point[0].y *= t,
                    this.lineWidth *= t,
                    this.textPosition.x *= t,
                    this.textPosition.y *= t,
                    this.RADIUS *= t
            },
            calcuZoomCoordinate: function(t, e, n, o) {
                var i, s;
                i = n / 30,
                    s = i,
                    this.component.point[0].x = this.component.point[0].x * i,
                    this.component.point[0].y = this.component.point[0].y * s
            },
            setBasicPara: function() {
                this.lineWidth = 3.5,
                    this.calcuZoomCoordinate(0, 0, 80, 80)
            },
            MoveOffset: function(t, e) {
                this.component.point[0].x += t,
                    this.component.point[0].y += e
            },
            showShape: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    e.lineWidth = this.lineWidth,
                    e.lineColor = this.lineColor,
                    e.lineStytle = this.lineStytle,
                    e.lineJoin = "round",
                    e.fillStyle = "rgba(255, 0, 0, 1)",
                    e.beginPath(),
                    e.arc(this.component.point[0].x, this.component.point[0].y, this.RADIUS, 0, 2 * Math.PI, !1),
                    e.stroke(),
                    e.fill(),
                    e.restore(),
                this.selected && this.showSelectedStatu(t)
            },
            showSelectedStatu: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    e.lineWidth = 1.6 * this.lineWidth,
                    e.lineColor = this.lineColor,
                    e.strokeStyle = this.strokeStyle,
                    e.lineStytle = this.lineStytle,
                    e.lineJoin = "round",
                    e.fillStyle = "rgba(255, 0, 0, 1)",
                    e.beginPath(),
                    e.arc(this.component.point[0].x, this.component.point[0].y, 1.2 * this.RADIUS, 0, 2 * Math.PI, !1),
                    e.stroke(),
                    e.restore()
            },
            inRotatePoint: function(t, e) {
                return ! 1
            },
            inControlPoint: function(t, e) {
                return ! 1
            },
            inShape: function(t, e) {
                var o = (Utils.copy(this.component.point[0]), t.getContext("2d"));
                return o.beginPath(),
                    o.arc(this.component.point[0].x, this.component.point[0].y, this.RADIUS, 0, 2 * Math.PI, !1),
                    o.isPointInPath(e.x, e.y) ? !0 : !1
            },
            getControlPoints: function() {
                return ! 1
            },
            getRotatePoint: function() {
                return ! 1
            }
        },
        metaTuoGuiQi: {
            id: 0,
            length: 10,
            type: "TUO_GUI_QI",
            category: "TUO_GUI_QI",
            name: "tuoguiqi",
            nameText: "脱轨器",
            textVisible: !0,
            selected: !1,
            strokeStyle: "rgba(234,43,12,0.3)",
            component: {
                point: [{
                    x: 0,
                    y: 0
                },
                    {
                        x: 0,
                        y: 0
                    },
                    {
                        x: 0,
                        y: 0
                    }]
            },
            lineWidth: 1.5,
            lineColor: "250,250,250",
            lineStytle: "solid",
            fontStytle: {
                fontFamily: "Arial",
                size: 13,
                color: "rgba(150,150,50,1)",
                bold: !1
            },
            textPosition: {
                x: 0,
                y: 5
            },
            objPostion: {
                x: 0,
                y: 0
            },
            setObjStatu: function(t, e) {},
            createObj: function(t, e, n, o, i) {
                this.name = t,
                    this.nameText = e,
                    this.objPostion.x = o,
                    this.objPostion.y = i,
                    this.type = n,
                    this.component.point[0].x = 0,
                    this.component.point[0].y = 0,
                    this.component.point[1].x = this.length,
                    this.component.point[1].y = 0,
                    this.component.point[2].x = this.length / 2,
                    this.component.point[2].y = -this.length
            },
            displayMetaShape: function(t, e, n) {
                var o = t.getContext("2d");
                o.save(),
                    o.lineWidth = this.lineWidth,
                    o.lineColor = this.lineColor,
                    o.lineStytle = this.lineStytle,
                    o.lineJoin = "round",
                    o.fillStyle = "rgba(0, 255, 0, 1)",
                    o.translate(this.objPostion.x, this.objPostion.y),
                    o.scale(2.3, 2.3),
                    o.beginPath(),
                    o.moveTo(this.component.point[0].x, this.component.point[0].y),
                    o.lineTo(this.component.point[1].x, this.component.point[1].y),
                    o.lineTo(this.component.point[2].x, this.component.point[2].y),
                    o.fill(),
                    o.restore()
            },
            renderShape: function(t) {
                this.lineWidth *= t,
                    this.fontStytle.size *= t,
                    this.textPosition.x *= t,
                    this.textPosition.y *= t,
                    this.component.point[0].x *= t,
                    this.component.point[0].y *= t,
                    this.component.point[1].x *= t,
                    this.component.point[1].y *= t,
                    this.component.point[2].x *= t,
                    this.component.point[2].y *= t
            },
            calcuZoomCoordinate: function(t, e, n, o) {
                var i, s;
                i = n / 30,
                    s = i,
                    this.component.point[0].x = this.component.point[0].x * i,
                    this.component.point[0].y = this.component.point[0].y * s,
                    this.component.point[1].x = this.component.point[1].x * i,
                    this.component.point[1].y = this.component.point[1].y * s,
                    this.component.point[2].x = this.component.point[2].x * i,
                    this.component.point[2].y = this.component.point[2].y * s
            },
            setBasicPara: function() {
                this.lineWidth = 3.5,
                    this.calcuZoomCoordinate(0, 0, 80, 80)
            },
            MoveOffset: function(t, e) {
                this.component.point[0].x += t,
                    this.component.point[0].y += e,
                    this.component.point[1].x += t,
                    this.component.point[1].y += e,
                    this.component.point[2].x += t,
                    this.component.point[2].y += e
            },
            showShape: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    e.lineWidth = this.lineWidth,
                    e.lineColor = this.lineColor,
                    e.lineStytle = this.lineStytle,
                    e.lineJoin = "round",
                    e.fillStyle = "rgba(0, 255, 0, 1)",
                    e.beginPath(),
                    e.moveTo(this.component.point[0].x, this.component.point[0].y),
                    e.lineTo(this.component.point[1].x, this.component.point[1].y),
                    e.lineTo(this.component.point[2].x, this.component.point[2].y),
                    e.fill(),
                    e.restore(),
                this.selected && this.showSelectedStatu(t)
            },
            showSelectedStatu: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    e.lineWidth = this.lineWidth,
                    e.strokeStyle = this.strokeStyle,
                    e.lineStytle = this.lineStytle,
                    e.lineJoin = "round",
                    e.lineWidth = 1.6 * this.lineWidth,
                    e.beginPath(),
                    e.moveTo(this.component.point[0].x, this.component.point[0].y),
                    e.lineTo(this.component.point[1].x, this.component.point[1].y),
                    e.lineTo(this.component.point[2].x, this.component.point[2].y),
                    e.lineTo(this.component.point[0].x, this.component.point[0].y),
                    e.stroke(),
                    e.restore()
            },
            inRotatePoint: function(t, e) {
                return ! 1
            },
            inControlPoint: function(t, e) {
                return ! 1
            },
            inShape: function(t, e) {
                var o = (Utils.copy(this.component.point[0]), t.getContext("2d"));
                return o.beginPath(),
                    o.moveTo(this.component.point[0].x, this.component.point[0].y),
                    o.lineTo(this.component.point[1].x, this.component.point[1].y),
                    o.lineTo(this.component.point[2].x, this.component.point[2].y),
                    o.isPointInPath(e.x, e.y) ? !0 : !1
            },
            getControlPoints: function() {
                return ! 1
            },
            getRotatePoint: function() {
                return ! 1
            }
        },
        metaQinXian: {
            id: 0,
            RADIUS: 6,
            type: "QIN_XIAN",
            category: "QIN_XIAN",
            name: "qinxian",
            nameText: "侵线绝缘",
            textVisible: !0,
            selected: !1,
            strokeStyle: "rgba(234,43,12,0.3)",
            component: {
                point: [{
                    x: 0,
                    y: 0
                }]
            },
            lineWidth: 2,
            lineColor: "rgba(255, 0, 0, 1)",
            lineStytle: "solid",
            fontStytle: {
                fontFamily: "Arial",
                size: 13,
                color: "rgba(150,150,50,1)",
                bold: !1
            },
            textPosition: {
                x: 0,
                y: 5
            },
            objPostion: {
                x: 0,
                y: 0
            },
            createObj: function(t, e, n, o, i) {
                this.name = t,
                    this.nameText = e,
                    this.objPostion.x = o,
                    this.objPostion.y = i,
                    this.type = n,
                    this.component.point[0].x = 0,
                    this.component.point[0].y = 0
            },
            displayMetaShape: function(t, e, n) {
                var o = t.getContext("2d");
                o.save(),
                    o.lineWidth = this.lineWidth,
                    o.strokeStyle = "rgba(255,0,0,1)",
                    o.lineStytle = this.lineStytle,
                    o.translate(this.objPostion.x, this.objPostion.y),
                    o.scale(1.4, 1.4),
                    o.beginPath(),
                    o.arc(this.component.point[0].x, this.component.point[0].y, this.RADIUS, 0, 2 * Math.PI, !1),
                    o.stroke(),
                    o.beginPath(),
                    o.moveTo(this.component.point[0].x, this.component.point[0].y - this.RADIUS),
                    o.lineTo(this.component.point[0].x, this.component.point[0].y + this.RADIUS),
                    o.stroke(),
                    o.restore()
            },
            renderShape: function(t) {
                this.fontStytle.size *= t,
                    this.lineWidth *= t,
                    this.textPosition.x *= t,
                    this.RADIUS *= t,
                    this.textPosition.y *= t,
                    this.component.point[0].x *= t,
                    this.component.point[0].y *= t
            },
            calcuZoomCoordinate: function(t, e, n, o) {
                var i, s;
                i = n / 30,
                    s = i,
                    this.component.point[0].x = this.component.point[0].x * i,
                    this.component.point[0].y = this.component.point[0].y * s
            },
            setBasicPara: function() {
                this.lineWidth = 2,
                    this.calcuZoomCoordinate(0, 0, 80, 80)
            },
            MoveOffset: function(t, e) {
                this.component.point[0].x += t,
                    this.component.point[0].y += e
            },
            showShape: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    e.lineWidth = this.lineWidth,
                    e.strokeStyle = "rgba(255,0,0,1)",
                    e.lineStytle = this.lineStytle,
                    e.beginPath(),
                    e.arc(this.component.point[0].x, this.component.point[0].y, this.RADIUS, 0, 2 * Math.PI, !1),
                    e.stroke(),
                    e.beginPath(),
                    e.moveTo(this.component.point[0].x, this.component.point[0].y - this.RADIUS),
                    e.lineTo(this.component.point[0].x, this.component.point[0].y + this.RADIUS),
                    e.stroke(),
                    e.restore(),
                this.selected && this.showSelectedStatu(t)
            },
            showSelectedStatu: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    e.lineWidth = 1.6 * this.lineWidth,
                    e.strokeStyle = this.strokeStyle,
                    e.lineStytle = this.lineStytle,
                    e.beginPath(),
                    e.arc(this.component.point[0].x, this.component.point[0].y, 1.2 * this.RADIUS, 0, 2 * Math.PI, !1),
                    e.stroke(),
                    e.restore()
            },
            inRotatePoint: function(t, e) {
                return ! 1
            },
            inControlPoint: function(t, e) {
                return ! 1
            },
            inShape: function(t, e) {
                var o = (Utils.copy(this.component.point[0]), t.getContext("2d"));
                return o.beginPath(),
                    o.arc(this.component.point[0].x, this.component.point[0].y, this.RADIUS, 0, 2 * Math.PI, !1),
                    o.isPointInPath(e.x, e.y) ? !0 : !1
            },
            getControlPoints: function() {
                return ! 1
            },
            getRotatePoint: function() {
                return ! 1
            }
        },
        metaStubEndSinding: {
            id: 0,
            length: 8,
            type: "STUB_END_SIDING",
            category: "STUB_END_SIDING",
            name: "stubendsiding",
            nameText: "尽头线",
            textVisible: !0,
            selected: !1,
            strokeStyle: "rgba(234,43,12,0.3)",
            component: {
                point: [{
                    x: 0,
                    y: 0
                },
                    {
                        x: 0,
                        y: 0
                    },
                    {
                        x: 0,
                        y: 0
                    },
                    {
                        x: 0,
                        y: 0
                    },
                    {
                        x: 0,
                        y: 0
                    }]
            },
            lineWidth: 1.5,
            lineColor: "rgba(255, 255, 255, 1)",
            lineStytle: "solid",
            fontStytle: {
                fontFamily: "Arial",
                size: 13,
                color: "50,50,50",
                bold: !1
            },
            textPosition: {
                x: 0,
                y: 5
            },
            objPostion: {
                x: 0,
                y: 0
            },
            setObjStatu: function(t, e) {},
            createObj: function(t, e, n, o, i, s) {
                this.name = t,
                    this.nameText = e,
                    this.objPostion.x = i,
                    this.objPostion.y = s,
                    this.type = n,
                    this.component.point[0].x = 0,
                    this.component.point[0].y = 0,
                    this.component.point[1].x = this.length,
                    this.component.point[1].y = 0,
                    this.component.point[2].x = 0,
                    this.component.point[2].y = this.length,
                    this.component.point[3].x = this.length,
                    this.component.point[3].y = this.length,
                    this.component.point[4].x = 2.5 * this.length,
                    this.component.point[4].y = this.length / 2,
                    this.calcuRotateAngel(o, this.component.point[4].x, this.component.point[4].y)
            },
            displayMetaShape: function(t, e, n) {
                var o = t.getContext("2d");
                o.save(),
                    o.lineWidth = .5 * this.lineWidth,
                    o.lineStytle = this.lineStytle,
                    o.lineJoin = "round",
                    o.translate(this.objPostion.x, this.objPostion.y),
                    o.scale(1.4, 1.4),
                    o.beginPath(),
                    o.moveTo(this.component.point[0].x, this.component.point[0].y),
                    o.lineTo(this.component.point[1].x, this.component.point[1].y),
                    o.lineTo(this.component.point[3].x, this.component.point[3].y),
                    o.lineTo(this.component.point[2].x, this.component.point[2].y),
                    o.stroke(),
                    o.beginPath(),
                    o.lineWidth = this.lineWidth,
                    o.moveTo(this.component.point[1].x, this.component.point[4].y),
                    o.lineTo(this.component.point[4].x, this.component.point[4].y),
                    o.stroke(),
                    o.restore()
            },
            renderShape: function(t) {
                this.lineWidth *= t,
                    this.length *= t,
                    this.textPosition.x *= t,
                    this.textPosition.y *= t,
                    this.fontStytle.size *= t,
                    this.component.point[0].x *= t,
                    this.component.point[0].y *= t,
                    this.component.point[1].x *= t,
                    this.component.point[1].y *= t,
                    this.component.point[2].x *= t,
                    this.component.point[2].y *= t,
                    this.component.point[3].x *= t,
                    this.component.point[3].y *= t,
                    this.component.point[4].x *= t,
                    this.component.point[4].y *= t
            },
            calcuZoomCoordinate: function(t, e, n, o) {
                var i, s;
                i = n / 30,
                    s = i,
                    this.component.point[0].x = this.component.point[0].x * i,
                    this.component.point[0].y = this.component.point[0].y * s,
                    this.component.point[1].x = this.component.point[1].x * i,
                    this.component.point[1].y = this.component.point[1].y * s,
                    this.component.point[2].x = this.component.point[2].x * i,
                    this.component.point[2].y = this.component.point[2].y * s,
                    this.component.point[3].x = this.component.point[3].x * i,
                    this.component.point[3].y = this.component.point[3].y * s,
                    this.component.point[4].x = this.component.point[4].x * i,
                    this.component.point[4].y = this.component.point[4].y * s
            },
            setBasicPara: function() {
                var t, e;
                this.lineWidth = 5,
                    this.calcuZoomCoordinate(0, 0, 80, 80),
                    "stubEndSindingS" == this.name ? (t = -this.objPostion.x, e = -this.objPostion.y) : (t = 3 * this.objPostion.x, e = -this.objPostion.y),
                    this.MoveOffset(t, e)
            },
            MoveOffset: function(t, e) {
                this.component.point[0].x += t,
                    this.component.point[0].y += e,
                    this.component.point[1].x += t,
                    this.component.point[1].y += e,
                    this.component.point[2].x += t,
                    this.component.point[2].y += e,
                    this.component.point[3].x += t,
                    this.component.point[3].y += e,
                    this.component.point[4].x += t,
                    this.component.point[4].y += e
            },
            showShape: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    e.lineWidth = .5 * this.lineWidth,
                    e.lineStytle = this.lineStytle,
                    e.lineJoin = "round",
                    e.beginPath(),
                    e.moveTo(this.component.point[0].x, this.component.point[0].y),
                    e.lineTo(this.component.point[1].x, this.component.point[1].y),
                    e.lineTo(this.component.point[3].x, this.component.point[3].y),
                    e.lineTo(this.component.point[2].x, this.component.point[2].y),
                    e.stroke(),
                    e.beginPath(),
                    e.lineWidth = this.lineWidth,
                    e.moveTo(this.component.point[1].x, this.component.point[4].y),
                    e.lineTo(this.component.point[4].x, this.component.point[4].y),
                    e.stroke(),
                    e.restore(),
                this.selected && this.showSelectedStatu(t)
            },
            showSelectedStatu: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    e.lineWidth = 2.1 * this.lineWidth,
                    e.lineStytle = this.lineStytle,
                    e.lineJoin = "round",
                    e.strokeStyle = this.strokeStyle,
                    e.beginPath(),
                    e.moveTo(this.component.point[0].x, this.component.point[0].y),
                    e.lineTo(this.component.point[1].x, this.component.point[1].y),
                    e.lineTo(this.component.point[3].x, this.component.point[3].y),
                    e.lineTo(this.component.point[2].x, this.component.point[2].y),
                    e.stroke(),
                    e.beginPath(),
                    e.lineWidth = 1.6 * this.lineWidth,
                    e.moveTo(this.component.point[1].x, this.component.point[4].y),
                    e.lineTo(this.component.point[4].x, this.component.point[4].y),
                    e.stroke(),
                    e.restore()
            },
            inRotatePoint: function(t, e) {
                return ! 1
            },
            inControlPoint: function(t, e) {
                return ! 1
            },
            inShape: function(t, e) {
                var o = (Utils.copy(this.component.point[0]), t.getContext("2d"));
                return o.beginPath(),
                    o.moveTo(this.component.point[0].x, this.component.point[0].y),
                    o.lineTo(this.component.point[4].x, this.component.point[0].y),
                    o.lineTo(this.component.point[4].x, this.component.point[2].y),
                    o.lineTo(this.component.point[2].x, this.component.point[2].y),
                    o.isPointInPath(e.x, e.y) ? !0 : !1
            },
            getControlPoints: function() {
                return ! 1
            },
            getRotatePoint: function() {
                return ! 1
            },
            calcuRotateAngel: function(t, e, n) {
                var o = {
                        x: e,
                        y: n
                    },
                    i = this.component;
                this.angel = t,
                this.angel >= 360 && (this.angel = 360);
                var s = Utils.rotateCoordinate(i.point[0], o, t);
                i.point[0].x = s.x,
                    i.point[0].y = s.y,
                    s = Utils.rotateCoordinate(i.point[1], o, t),
                    i.point[1].x = s.x,
                    i.point[1].y = s.y,
                    s = Utils.rotateCoordinate(i.point[2], o, t),
                    i.point[2].x = s.x,
                    i.point[2].y = s.y,
                    s = Utils.rotateCoordinate(i.point[3], o, t),
                    i.point[3].x = s.x,
                    i.point[3].y = s.y,
                    s = Utils.rotateCoordinate(i.point[4], o, t),
                    i.point[4].x = s.x,
                    i.point[4].y = s.y
            }
        },
        meta64D: {
            id: 0,
            length: 13,
            type: "64D",
            category: "64D",
            name: "64d",
            nameText: "64D半自动",
            textVisible: !0,
            selected: !1,
            strokeStyle: "rgba(234,43,12,0.3)",
            component: {
                point: [{
                    x: 0,
                    y: 0
                },
                    {
                        x: 0,
                        y: 0
                    },
                    {
                        x: 0,
                        y: 0
                    },
                    {
                        x: 0,
                        y: 0
                    },
                    {
                        x: 0,
                        y: 0
                    },
                    {
                        x: 0,
                        y: 0
                    },
                    {
                        x: 0,
                        y: 0
                    }]
            },
            lineWidth: 1.5,
            lineColor: "rgba(255, 0, 0, 1)",
            lineStytle: "solid",
            fontStytle: {
                fontFamily: "Arial",
                size: 13,
                color: "50,50,50",
                bold: !1
            },
            textPosition: {
                x: 0,
                y: 5
            },
            objPostion: {
                x: 0,
                y: 0
            },
            setObjStatu: function(t, e) {},
            createObj: function(t, e, n, o, i, s) {
                this.name = t,
                    this.nameText = e,
                    this.objPostion.x = i,
                    this.objPostion.y = s,
                    this.type = n,
                    this.component.point[0].x = -1,
                    this.component.point[0].y = 0,
                    this.component.point[1].x = this.length / 2,
                    this.component.point[1].y = -this.length / 2,
                    this.component.point[2].x = this.length / 2,
                    this.component.point[2].y = -this.length / 4,
                    this.component.point[3].x = this.length,
                    this.component.point[3].y = -this.length / 4,
                    this.component.point[4].x = this.length,
                    this.component.point[4].y = this.length / 4,
                    this.component.point[5].x = this.length / 2,
                    this.component.point[5].y = this.length / 4,
                    this.component.point[6].x = this.length / 2,
                    this.component.point[6].y = this.length / 2,
                    this.calcuRotateAngel(o, this.component.point[0].x, this.component.point[0].y)
            },
            displayMetaShape: function(t, e, n) {
                var o = t.getContext("2d");
                o.save(),
                    o.lineWidth = this.lineWidth,
                    o.lineStytle = this.lineStytle,
                    o.fillStyle = this.lineColor,
                    o.lineJoin = "round",
                    o.translate(this.objPostion.x, this.objPostion.y),
                    o.scale(1.4, 1.4),
                    o.beginPath(),
                    o.moveTo(this.component.point[0].x, this.component.point[0].y),
                    o.lineTo(this.component.point[1].x, this.component.point[1].y),
                    o.lineTo(this.component.point[2].x, this.component.point[2].y),
                    o.lineTo(this.component.point[3].x, this.component.point[3].y),
                    o.lineTo(this.component.point[4].x, this.component.point[4].y),
                    o.lineTo(this.component.point[5].x, this.component.point[5].y),
                    o.lineTo(this.component.point[6].x, this.component.point[6].y),
                    o.lineTo(this.component.point[0].x, this.component.point[0].y),
                    o.fill(),
                    o.restore()
            },
            renderShape: function(t) {
                this.lineWidth *= t,
                    this.length *= t,
                    this.textPosition.x *= t,
                    this.textPosition.y *= t,
                    this.fontStytle.size *= t,
                    this.component.point[0].x *= t,
                    this.component.point[0].y *= t,
                    this.component.point[1].x *= t,
                    this.component.point[1].y *= t,
                    this.component.point[2].x *= t,
                    this.component.point[2].y *= t,
                    this.component.point[3].x *= t,
                    this.component.point[3].y *= t,
                    this.component.point[4].x *= t,
                    this.component.point[4].y *= t,
                    this.component.point[5].x *= t,
                    this.component.point[5].y *= t,
                    this.component.point[6].x *= t,
                    this.component.point[6].y *= t
            },
            calcuZoomCoordinate: function(t, e, n, o) {
                var i, s;
                i = n / 30,
                    s = i,
                    this.component.point[0].x = this.component.point[0].x * i,
                    this.component.point[0].y = this.component.point[0].y * s,
                    this.component.point[1].x = this.component.point[1].x * i,
                    this.component.point[1].y = this.component.point[1].y * s,
                    this.component.point[2].x = this.component.point[2].x * i,
                    this.component.point[2].y = this.component.point[2].y * s,
                    this.component.point[3].x = this.component.point[3].x * i,
                    this.component.point[3].y = this.component.point[3].y * s,
                    this.component.point[4].x = this.component.point[4].x * i,
                    this.component.point[4].y = this.component.point[4].y * s,
                    this.component.point[5].x = this.component.point[5].x * i,
                    this.component.point[5].y = this.component.point[5].y * s,
                    this.component.point[6].x = this.component.point[6].x * i,
                    this.component.point[6].y = this.component.point[6].y * s
            },
            setBasicPara: function() {
                var t, e;
                this.lineWidth = 5,
                    this.calcuZoomCoordinate(0, 0, 80, 80),
                    "64ds" == this.name ? (t = -this.objPostion.x, e = -this.objPostion.y) : (t = 5 * this.objPostion.x, e = -this.objPostion.y)
            },
            MoveOffset: function(t, e) {
                this.component.point[0].x += t,
                    this.component.point[0].y += e,
                    this.component.point[1].x += t,
                    this.component.point[1].y += e,
                    this.component.point[2].x += t,
                    this.component.point[2].y += e,
                    this.component.point[3].x += t,
                    this.component.point[3].y += e,
                    this.component.point[4].x += t,
                    this.component.point[4].y += e,
                    this.component.point[5].x += t,
                    this.component.point[5].y += e,
                    this.component.point[6].x += t,
                    this.component.point[6].y += e
            },
            showShape: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    e.lineWidth = this.lineWidth,
                    e.lineStytle = this.lineStytle,
                    e.fillStyle = this.lineColor,
                    e.lineJoin = "round",
                    e.beginPath(),
                    e.moveTo(this.component.point[0].x, this.component.point[0].y),
                    e.lineTo(this.component.point[1].x, this.component.point[1].y),
                    e.lineTo(this.component.point[2].x, this.component.point[2].y),
                    e.lineTo(this.component.point[3].x, this.component.point[3].y),
                    e.lineTo(this.component.point[4].x, this.component.point[4].y),
                    e.lineTo(this.component.point[5].x, this.component.point[5].y),
                    e.lineTo(this.component.point[6].x, this.component.point[6].y),
                    e.lineTo(this.component.point[0].x, this.component.point[0].y),
                    e.fill(),
                    e.restore(),
                this.selected && this.showSelectedStatu(t)
            },
            showSelectedStatu: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    e.lineWidth = 1.6 * this.lineWidth,
                    e.strokeStyle = this.strokeStyle,
                    e.lineStytle = this.lineStytle,
                    e.fillStyle = this.lineColor,
                    e.lineJoin = "round",
                    e.beginPath(),
                    e.moveTo(this.component.point[0].x, this.component.point[0].y),
                    e.lineTo(this.component.point[1].x, this.component.point[1].y),
                    e.lineTo(this.component.point[2].x, this.component.point[2].y),
                    e.lineTo(this.component.point[3].x, this.component.point[3].y),
                    e.lineTo(this.component.point[4].x, this.component.point[4].y),
                    e.lineTo(this.component.point[5].x, this.component.point[5].y),
                    e.lineTo(this.component.point[6].x, this.component.point[6].y),
                    e.lineTo(this.component.point[0].x, this.component.point[0].y),
                    e.stroke(),
                    e.restore()
            },
            inRotatePoint: function(t, e) {
                return ! 1
            },
            inControlPoint: function(t, e) {
                return ! 1
            },
            inShape: function(t, e) {
                var o = (Utils.copy(this.component.point[0]), t.getContext("2d"));
                return o.beginPath(),
                    o.moveTo(this.component.point[0].x, this.component.point[0].y),
                    o.lineTo(this.component.point[1].x, this.component.point[1].y),
                    o.lineTo(this.component.point[2].x, this.component.point[2].y),
                    o.lineTo(this.component.point[3].x, this.component.point[3].y),
                    o.lineTo(this.component.point[4].x, this.component.point[4].y),
                    o.lineTo(this.component.point[5].x, this.component.point[5].y),
                    o.lineTo(this.component.point[6].x, this.component.point[6].y),
                    o.isPointInPath(e.x, e.y) ? !0 : !1
            },
            getControlPoints: function() {
                return ! 1
            },
            getRotatePoint: function() {
                return ! 1
            },
            calcuRotateAngel: function(t, e, n) {
                var o = {
                        x: e,
                        y: n
                    },
                    i = this.component;
                this.angel = t,
                this.angel >= 360 && (this.angel = 360);
                var s = Utils.rotateCoordinate(i.point[0], o, t);
                i.point[0].x = s.x,
                    i.point[0].y = s.y,
                    s = Utils.rotateCoordinate(i.point[1], o, t),
                    i.point[1].x = s.x,
                    i.point[1].y = s.y,
                    s = Utils.rotateCoordinate(i.point[2], o, t),
                    i.point[2].x = s.x,
                    i.point[2].y = s.y,
                    s = Utils.rotateCoordinate(i.point[3], o, t),
                    i.point[3].x = s.x,
                    i.point[3].y = s.y,
                    s = Utils.rotateCoordinate(i.point[4], o, t),
                    i.point[4].x = s.x,
                    i.point[4].y = s.y,
                    s = Utils.rotateCoordinate(i.point[5], o, t),
                    i.point[5].x = s.x,
                    i.point[5].y = s.y,
                    s = Utils.rotateCoordinate(i.point[6], o, t),
                    i.point[6].x = s.x,
                    i.point[6].y = s.y
            }
        },
        metaButton: {
            id: 0,
            length: 14,
            type: "BUTTON",
            category: "BUTTON",
            name: "",
            nameText: "按钮",
            textVisible: !0,
            selected: !1,
            strokeStyle: "rgba(234,43,12,0.3)",
            throat: "",
            qianNode: -1,
            houNode: -1,
            signalIndex: -1,
            buttonType: "BGBUTTON",
            component: {
                point: [{
                    x: 0,
                    y: 0
                }]
            },
            lineWidth: 1.5,
            lineColor: "250,250,250",
            outColor: "rgba(128,128,128, 1)",
            midColor: "rgba(255, 255, 255, 1)",
            inColor: "rgba(0,153,0, 1)",
            lineStytle: "solid",
            fontStytle: {
                fontFamily: "Arial",
                size: 13,
                color: "rgba(150,150,50,1)",
                bold: !1
            },
            textPosition: {
                x: 0,
                y: 5
            },
            objPostion: {
                x: 0,
                y: 0
            },
            setObjStatu: function(t, e) {},
            createObj: function(t, e, n, o, i) {
                this.name = t,
                    this.nameText = e,
                    this.objPostion.x = o,
                    this.objPostion.y = i,
                    this.type = n,
                    this.component.point[0].x = 0,
                    this.component.point[0].y = 0
            },
            displayMetaShape: function(t, e, n) {
                var o = t.getContext("2d");
                o.save(),
                    o.lineWidth = this.lineWidth,
                    o.lineColor = this.lineColor,
                    o.lineStytle = this.lineStytle,
                    o.lineJoin = "round",
                    o.translate(this.objPostion.x, this.objPostion.y),
                    o.scale(1.2, 1.2),
                    o.beginPath(),
                    o.strokeStyle = this.outColor,
                    o.rect(this.component.point[0].x, this.component.point[0].y, this.component.point[0].x + this.length, this.component.point[0].y + this.length),
                    o.stroke(),
                    o.beginPath(),
                    o.strokeStyle = this.midColor,
                    o.moveTo(this.component.point[0].x, this.component.point[0].y + this.lineWidth),
                    o.lineTo(this.component.point[0].x, this.component.point[0].y + this.length - .5 * this.lineWidth),
                    o.moveTo(this.component.point[0].x - this.lineWidth / 2, this.component.point[0].y + this.lineWidth),
                    o.lineTo(this.component.point[0].x + this.length - this.lineWidth / 2, this.component.point[0].y + this.lineWidth),
                    o.stroke(),
                    o.beginPath(),
                    o.fillStyle = this.inColor,
                    o.rect(this.component.point[0].x + this.lineWidth / 2, this.component.point[0].y + 1.5 * this.lineWidth, this.component.point[0].x + this.length - this.lineWidth, this.component.point[0].y + this.length - 2 * this.lineWidth),
                    o.fill(),
                    o.restore()
            },
            renderShape: function(t) {
                this.lineWidth *= t,
                    this.length *= t,
                    this.fontStytle.size *= t,
                    this.textPosition.x *= t,
                    this.textPosition.y *= t,
                    this.component.point[0].x *= t,
                    this.component.point[0].y *= t
            },
            calcuZoomCoordinate: function(t, e, n, o) {
                var i, s;
                i = n / 30,
                    s = i,
                    this.component.point[0].x = this.component.point[0].x * i,
                    this.component.point[0].y = this.component.point[0].y * s
            },
            setBasicPara: function() {
                this.lineWidth = 1.5,
                    this.calcuZoomCoordinate(0, 0, 80, 80)
            },
            MoveOffset: function(t, e) {
                this.component.point[0].x += t,
                    this.component.point[0].y += e
            },
            showShape: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    e.lineWidth = this.lineWidth,
                    e.lineColor = this.lineColor,
                    e.lineStytle = this.lineStytle,
                    e.lineJoin = "round",
                    e.beginPath(),
                    e.strokeStyle = this.outColor,
                    e.rect(this.component.point[0].x, this.component.point[0].y, this.length, this.length),
                    e.stroke(),
                    e.beginPath(),
                    e.strokeStyle = this.midColor,
                    e.moveTo(this.component.point[0].x, this.component.point[0].y + this.lineWidth),
                    e.lineTo(this.component.point[0].x, this.component.point[0].y + this.length - .5 * this.lineWidth),
                    e.moveTo(this.component.point[0].x, this.component.point[0].y + this.lineWidth),
                    e.lineTo(this.component.point[0].x + this.length - this.lineWidth / 2, this.component.point[0].y + this.lineWidth),
                    e.stroke(),
                    e.beginPath(),
                    e.fillStyle = this.inColor,
                    e.rect(this.component.point[0].x + this.lineWidth / 2, this.component.point[0].y + 1.5 * this.lineWidth, this.length - this.lineWidth, this.length - 2 * this.lineWidth),
                    e.fill(),
                    e.restore(),
                this.selected && this.showSelectedStatu(t)
            },
            showSelectedStatu: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    e.lineWidth = 4 * this.lineWidth,
                    e.strokeStyle = this.strokeStyle,
                    e.lineColor = this.lineColor,
                    e.lineStytle = this.lineStytle,
                    e.lineJoin = "round",
                    e.beginPath(),
                    e.rect(this.component.point[0].x, this.component.point[0].y, this.length, this.length),
                    e.stroke(),
                    e.restore()
            },
            inRotatePoint: function(t, e) {
                return ! 1
            },
            inControlPoint: function(t, e) {
                return ! 1
            },
            inShape: function(t, e) {
                var o = (Utils.copy(this.component.point[0]), t.getContext("2d"));
                return o.beginPath(),
                    o.rect(this.component.point[0].x, this.component.point[0].y, this.length, this.length),
                    o.isPointInPath(e.x, e.y) ? !0 : !1
            },
            getControlPoints: function() {
                return ! 1
            },
            getRotatePoint: function() {
                return ! 1
            }
        },
        metaTextShap: {
            id: 0,
            length: 14,
            type: "TEXT",
            category: "TEXT",
            name: "text",
            nameText: "文字",
            textVisible: !0,
            selected: !1,
            strokeStyle: "rgba(234,43,12,0.3)",
            component: {
                point: [{
                    x: 0,
                    y: 0
                },
                    {
                        x: 0,
                        y: 0
                    },
                    {
                        x: 0,
                        y: 0
                    }]
            },
            lineWidth: 1.5,
            lineColor: "250,250,250",
            lineStytle: "solid",
            fontStytle: {
                fontFamily: "Arial",
                size: 20,
                color: "rgba(150,150,50,1)",
                bold: !1
            },
            textPosition: {
                x: 0,
                y: 5
            },
            objPostion: {
                x: 0,
                y: 0
            },
            setObjStatu: function(t, e) {},
            createObj: function(t, e, n, o, i) {
                this.name = t,
                    this.nameText = e,
                    this.objPostion.x = o,
                    this.objPostion.y = i,
                    this.type = n,
                    this.component.point[0].x = 0,
                    this.component.point[0].y = 0,
                    this.component.point[1].x = this.length,
                    this.component.point[1].y = 0,
                    this.component.point[2].x = this.length / 2,
                    this.component.point[2].y = this.length
            },
            displayMetaShape: function(t, e, n) {
                var o = t.getContext("2d");
                o.save(),
                    o.lineWidth = this.lineWidth,
                    o.lineColor = this.lineColor,
                    o.lineStytle = this.lineStytle,
                    o.lineJoin = "round",
                    o.translate(this.objPostion.x, this.objPostion.y),
                    o.scale(1.2, 1.2),
                    o.beginPath(),
                    o.moveTo(this.component.point[0].x, this.component.point[0].y),
                    o.lineTo(this.component.point[1].x, this.component.point[1].y),
                    o.moveTo(this.component.point[0].x + this.length / 2, this.component.point[0].y),
                    o.lineTo(this.component.point[2].x, this.component.point[2].y),
                    o.stroke(),
                    o.restore()
            },
            renderShape: function(t) {
                this.lineWidth *= t,
                    this.fontStytle.size *= t,
                    this.length *= t,
                    this.textPosition.x *= t,
                    this.textPosition.y *= t,
                    this.component.point[0].x *= t,
                    this.component.point[0].y *= t,
                    this.component.point[1].x *= t,
                    this.component.point[1].y *= t,
                    this.component.point[2].x *= t,
                    this.component.point[2].y *= t
            },
            calcuZoomCoordinate: function(t, e, n, o) {
                var i, s;
                i = n / 30,
                    s = i,
                    this.component.point[0].x = this.component.point[0].x * i,
                    this.component.point[0].y = this.component.point[0].y * s,
                    this.component.point[1].x = this.component.point[1].x * i,
                    this.component.point[1].y = this.component.point[1].y * s,
                    this.component.point[2].x = this.component.point[2].x * i,
                    this.component.point[2].y = this.component.point[2].y * s
            },
            setBasicPara: function() {
                this.lineWidth = 3.5
            },
            MoveOffset: function(t, e) {
                this.component.point[0].x += t,
                    this.component.point[0].y += e,
                    this.component.point[1].x += t,
                    this.component.point[1].y += e,
                    this.component.point[2].x += t,
                    this.component.point[2].y += e
            },
            showShape: function(t) {
                t.getContext("2d");
                this.showText(t, !0)
            },
            inRotatePoint: function(t, e) {
                return ! 1
            },
            inControlPoint: function(t, e) {
                return ! 1
            },
            inShape: function(t, e) {
                var o = (Utils.copy(this.component.point[0]), t.getContext("2d"));
                return o.beginPath(),
                    o.rect(this.component.point[0].x, this.component.point[0].y, 3 * this.fontStytle.size / 2, this.fontStytle.size / 2),
                    o.isPointInPath(e.x, e.y) ? !0 : !1
            },
            getControlPoints: function() {
                return ! 1
            },
            getRotatePoint: function() {
                return ! 1
            },
            updateTextPostion: function() {
                this.textPosition.x = this.component.point[0].x,
                    this.textPosition.y = this.component.point[0].y
            },
            showText: function(t, e) {
                if (this.updateTextPostion(), e) {
                    var n = t.getContext("2d");
                    n.save(),
                        n.font = this.fontStytle.size + "px " + this.fontStytle.fontFamily,
                        n.textBaseline = "middle",
                        n.textAlign = "left",
                        n.fillStyle = this.fontStytle.color,
                        n.strokeStyle = this.fontStytle.color,
                        n.fillText(this.name, this.textPosition.x, this.textPosition.y),
                        n.restore()
                }
            }
        },
        metaJYJ: {
            id: 0,
            length: 15,
            type: "JYJ",
            category: "JYJ",
            name: "JYJ",
            nameText: "绝缘节",
            textVisible: !0,
            selected: !1,
            strokeStyle: "rgba(234,43,12,0.3)",
            component: {
                point: [{
                    x: 0,
                    y: 0
                },
                    {
                        x: 6,
                        y: 0
                    }]
            },
            lineWidth: 2.5,
            lineColor: "rgba(0, 0, 0, 1)",
            lineStytle: "solid",
            fontStytle: {
                fontFamily: "Arial",
                size: 13,
                color: "50,50,50",
                bold: !1
            },
            textPosition: {
                x: 0,
                y: 5
            },
            objPostion: {
                x: 0,
                y: 0
            },
            setObjStatu: function(t, e) {},
            createObj: function(t, e, n, o, i, s) {
                this.name = t,
                    this.nameText = e,
                    this.objPostion.x = i,
                    this.objPostion.y = s,
                    this.type = n,
                    this.component.point[0].x = 0,
                    this.component.point[0].y = 0,
                    this.component.point[1].x = this.length,
                    this.component.point[1].y = 0,
                    this.calcuRotateAngel(o, this.component.point[0].x, this.component.point[0].y)
            },
            displayMetaShape: function(t, e, n) {
                var o = t.getContext("2d");
                o.save(),
                    o.lineWidth = this.lineWidth,
                    o.lineStytle = this.lineStytle,
                    o.fillStyle = this.lineColor,
                    o.lineJoin = "round",
                    o.translate(this.objPostion.x, this.objPostion.y),
                    o.scale(1.4, 1.4),
                    o.beginPath(),
                    o.moveTo(this.component.point[0].x, this.component.point[0].y),
                    o.lineTo(this.component.point[1].x, this.component.point[1].y),
                    o.stroke(),
                    o.restore()
            },
            renderShape: function(t) {
                this.lineWidth *= t,
                    this.length *= t,
                    this.textPosition.x *= t,
                    this.textPosition.y *= t,
                    this.fontStytle.size *= t,
                    this.component.point[0].x *= t,
                    this.component.point[0].y *= t,
                    this.component.point[1].x *= t,
                    this.component.point[1].y *= t
            },
            calcuZoomCoordinate: function(t, e, n, o) {
                var i, s;
                i = n / 30,
                    s = i,
                    this.component.point[0].x = this.component.point[0].x * i,
                    this.component.point[0].y = this.component.point[0].y * s,
                    this.component.point[1].x = this.component.point[1].x * i,
                    this.component.point[1].y = this.component.point[1].y * s
            },
            setBasicPara: function() {
                var t, e;
                this.lineWidth = 2.5,
                    this.calcuZoomCoordinate(0, 0, 80, 80),
                    "JYJH" == this.name ? (t = -this.objPostion.x, e = -this.objPostion.y) : (t = 5 * this.objPostion.x, e = -this.objPostion.y)
            },
            MoveOffset: function(t, e) {
                this.component.point[0].x += t,
                    this.component.point[0].y += e,
                    this.component.point[1].x += t,
                    this.component.point[1].y += e
            },
            showShape: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    e.lineWidth = this.lineWidth,
                    e.lineStytle = this.lineStytle,
                    e.fillStyle = this.lineColor,
                    e.lineJoin = "round",
                    e.beginPath(),
                    e.moveTo(this.component.point[0].x, this.component.point[0].y),
                    e.lineTo(this.component.point[1].x, this.component.point[1].y),
                    e.stroke(),
                    e.restore(),
                this.selected && this.showSelectedStatu(t)
            },
            showSelectedStatu: function(t) {
                var e = t.getContext("2d");
                e.save(),
                    e.lineWidth = 1.6 * this.lineWidth,
                    e.strokeStyle = this.strokeStyle,
                    e.lineStytle = this.lineStytle,
                    e.fillStyle = this.lineColor,
                    e.lineJoin = "round",
                    e.beginPath(),
                    e.moveTo(this.component.point[0].x, this.component.point[0].y),
                    e.lineTo(this.component.point[1].x, this.component.point[1].y),
                    e.stroke(),
                    e.restore()
            },
            inRotatePoint: function(t, e) {
                return ! 1
            },
            inControlPoint: function(t, e) {
                return ! 1
            },
            inShape: function(t, e) {
                var n = Utils.copy(this.component.point[1]),
                    o = Utils.copy(this.component.point[0]),
                    i = Utils.calcuAngel(n, o);
                i = 180 * i / Math.PI;
                var s = Utils.rotateCoordinate(n, o, -i),
                    a = Utils.rotateCoordinate(e, o, -i),
                    h = [o.x, o.y - 5, s.x, s.y + 5],
                    r = t.getContext("2d");
                return r.beginPath(),
                    r.rect(h[0], h[1], h[2] - h[0], h[3] - h[1]),
                    r.isPointInPath(a.x, a.y) ? !0 : !1
            },
            getControlPoints: function() {
                return ! 1
            },
            getRotatePoint: function() {
                return ! 1
            },
            calcuRotateAngel: function(t, e, n) {
                var o = {
                        x: e,
                        y: n
                    },
                    i = this.component;
                this.angel = t,
                this.angel >= 360 && (this.angel = 360);
                var s = Utils.rotateCoordinate(i.point[0], o, t);
                i.point[0].x = s.x,
                    i.point[0].y = s.y,
                    s = Utils.rotateCoordinate(i.point[1], o, t),
                    i.point[1].x = s.x,
                    i.point[1].y = s.y
            },
            createShape: function(t, e) {
                var n = this.component.point,
                    o = Utils.calcuAngel(e, t);
                o = 180 * o / Math.PI;
                var i = Utils.rotateCoordinate(e, t, -o);
                n[0].x = i.x,
                    n[0].y = i.y - this.length / 2,
                    n[1].x = i.x,
                    n[1].y = i.y + this.length / 2,
                    n[0] = Utils.rotateCoordinate(n[0], t, o),
                    n[1] = Utils.rotateCoordinate(n[1], t, o)
            }
        },
        metaRecShape: {},
        metaArrowShape: {},
        metaCircleShape: {}
    };